
Understanding async/await - discord.js Guide
2025年1月16日 · Promises are a way to handle asynchronous tasks in JavaScript; they are the newer alternative to callbacks. A Promise has many similarities to a progress bar; they represent an unfinished and ongoing process. An excellent example of this is a request to a server (e.g., discord.js sends requests to Discord's API).
GitHub - Vinlock/promise-bot-elixir: A Discord bot written in Elixir ...
A Discord bot written in Elixir that uses OpenAI. Contribute to Vinlock/promise-bot-elixir development by creating an account on GitHub.
Promise一篇吃透,手把手实现手写Promisejavascript-promise的 …
2023年5月22日 · 为了兼容以往对异步处理的方法,以及解决以往异步处理事件和回调的缺陷,ES6使用了Promise A+规范,来专门处理异步问题:避免回调地狱,使异步代码更加整洁、统一。 promise A+规范:
Promise详解大全:介绍、九个方法使用和区别、返回值详解_new promise …
2023年8月24日 · Promise 是异步编程的一种解决方案, 它的 构造函数 是 同步 执行的,then 方法是 异步 执行的,所以Promise创建后里面的 函数 会立即执行,构造函数中的resolve和reject只有第一次执行有效,,也就是说 Promise状态一旦改变就不能再变. promise主要是用来解决 回调地狱 的问题,通过使用.then来使得代码成链式调用,方便维护和使用。 .then中的回调函数属于异步任务中的微任务. promise一共有3个状态: pending、fulfilled和rejected.
超详细 Promise 介绍,优雅地实现异步任务,手撕 Promise_异步promise …
所谓 Promise,简单说就是一个容器,里面保存着某个未来才会结束的事件(通常是一个异步操作)的结果。从语法上说,Promise 是一个对象,从它可以获取异步操作的消息。Promise 提供统一的 API,各种异步操作都可以用同样的方法进行处理。
the-web-team/promise-bot: Discord Bot for The Web Team Discord - GitHub
Discord Bot for The Web Team Discord. Contribute to the-web-team/promise-bot development by creating an account on GitHub.
大白话讲Promise(最详细) - CSDN博客
promise就是一个 异步编程 的解决方案,ok我猜你应该没明白。 gpt 告诉我他是一个 用来管理任务状态和结果的容器。 它有三种状态:pending,fulfilled,rejected, 而且状态的变化只可以从 pending-->fufilled;pending-->rejected. promise有什么用? 这个问题就要追朔到回调 函数 以及js的异步机制上了。 js是单线程语言,同一时间内只能执行一个任务。 如果其中一个任务执行时间很长,那么后续的任务就要等待很久才能执行。
promise/discord-bot-boilerplate: A boilerplate for my bots - GitHub
A boilerplate for my bots. Contribute to promise/discord-bot-boilerplate development by creating an account on GitHub.
How to handle [object Promise] in Discord.js google-images …
2018年8月22日 · You need to use Promise.then(). When a promise is fulfilled, the value that it "returns" is passed as an argument to the function you put in .then() . Here's an example:
Promises · A Guide to Discord Bots - maah.gitbooks.io
A Guide to Discord Bots Promises. A promise is the result of an asynchronous function. The promise will first be pending, and then fulfilled if the function was successful, or rejected if it was not. If the promise is: pending: we cannot get it yet ; fulfilled: we will get it with .then() rejected: we will get it with .catch() Let's take a ...