@davidklushin
Фанат музыки.

Как поменять или написать Cтатус бота Discord?

Как поменять или написать Cтатус бота Discord?
У некоторых ботов дискорде есть статс, обычно это "Смотри сайт..." и т.д, можно ли с помощью JS написать такой код и если да, то как это сделать?

5f6c9a9d68a95273542068.png

Я просмотрел много кодов, что нашёл в нете, но бот постоянно пишет ошибку

(node:13980) UnhandledPromiseRejectionWarning: ReferenceError: bot is not defined
    at Client.<anonymous> (D:\DISCORD BOTS\Everest Role Play\bot.js:11:2)
    at Client.emit (events.js:315:20)
    at WebSocketManager.triggerClientReady (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketManager.js:431:17)
    at WebSocketManager.checkShardsReady (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketManager.js:415:10)
    at WebSocketShard.<anonymous> (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketManager.js:197:14)
    at WebSocketShard.emit (events.js:315:20)
    at WebSocketShard.checkReady (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
    at WebSocketShard.onPacket (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
    at WebSocketShard.onMessage (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (D:\DISCORD BOTS\Everest Role Play\node_modules\ws\lib\event-target.js:125:16)
(node:13980) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13980) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13980) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (D:\DISCORD BOTS\Everest Role Play\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:13980) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
  • Вопрос задан
  • 134 просмотра
Пригласить эксперта
Ответы на вопрос 2
Alexandre888
@Alexandre888 Куратор тега Боты
Javascript-разработчик
ваша ошибка в том, что вы пишете бота без малейших понятий в языке программирования.
ошибка указывает на 11ую строку, смотрим:
client.user.setActivity("Minecraft", {
    type: "STREAMING",
    url: "https://www.mine.com"
});

объясните мне, что по вашему означает "client"?
ко всему прочему, в описание вопроса вы добавили ошибку, несоответствующую коду
Ответ написан
AlmondPark33609
@AlmondPark33609
Занимаюсь кодингом как хобби
client.on('ready', () => {
   client.user.setPresence({
       status: 'idle',
       activity: {
         type: 'PLAYING'
         name: 'Minecraft'
       }
   })
})
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы