Botum sunucuya alındığında alan kişiye mesaj gitsin.

Katılım
22 Mar 2021
Konular
7
Mesajlar
33
Tepki puanı
3
Puanları
360
Birisi botumu bir sunucuya aldığında dm den ona mesaj gitsin. Embed bir biçimde. Nasıl yaparım?
 
Katılım
10 Kas 2019
Konular
225
Mesajlar
1,057
Çözümler
19
Tepki puanı
1,049
Puanları
8,710
Sunucu sahibine mi mesaj gitmesini istiyorsun? Yoksa herhangi bir kanala mı?
 
Oyla 0
Katılım
10 Kas 2019
Konular
225
Mesajlar
1,057
Çözümler
19
Tepki puanı
1,049
Puanları
8,710
Birisi botumu bir sunucuya aldığında dm den ona mesaj gitsin. Embed bir biçimde. Nasıl yaparım?
Embedsiz;
JavaScript:
client.on("guildCreate", (guild) => {
guild.owner.send(`Beni sunucuna aldığın için teşekkür ederim.!`)
});

Embedli;

JavaScript:
  client.on("guildCreate", (guild) => {
const embed = new Discord.MessageEmbed()
.setDescription('Beni sunucuna aldığın için teşekkür ederim.!')
.setFooter('Oyuncular Şehri | Türk Oyuncu Topluluğu')
guild.owner.send(embed)
  });
 
  • Beğen
Tepkiler: v12Tayfa
Oyla 0
Katılım
22 Mar 2021
Konular
7
Mesajlar
33
Tepki puanı
3
Puanları
360
Embedsiz;
JavaScript:
client.on("guildCreate", (guild) => {
guild.owner.send(`Beni sunucuna aldığın için teşekkür ederim.!`)
});

Embedli;

JavaScript:
  client.on("guildCreate", (guild) => {
const embed = new Discord.MessageEmbed()
.setDescription('Beni sunucuna aldığın için teşekkür ederim.!')
.setFooter('Oyuncular Şehri | Türk Oyuncu Topluluğu')
guild.owner.send(embed)
  });
(node:524) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
(node:524) 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:524) [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.

ID olan yerlere baktığımda hiç sorun çıkarmayan şeyler var. Bu kodu ekledikten sonra id of null hatası vermeye başladı
 
Oyla 0
Katılım
22 Mar 2021
Konular
7
Mesajlar
33
Tepki puanı
3
Puanları
360
(node:524) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
(node:524) 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:524) [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.

ID olan yerlere baktığımda hiç sorun çıkarmayan şeyler var. Bu kodu ekledikten sonra id of null hatası vermeye başladı
@ArdaDemr
 
Oyla 0
Katılım
22 Mar 2021
Konular
7
Mesajlar
33
Tepki puanı
3
Puanları
360
1620128769369.png
 
Oyla 0
Katılım
10 Kas 2019
Konular
225
Mesajlar
1,057
Çözümler
19
Tepki puanı
1,049
Puanları
8,710
(node:524) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
(node:524) 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:524) [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.

ID olan yerlere baktığımda hiç sorun çıkarmayan şeyler var. Bu kodu ekledikten sonra id of null hatası vermeye başladı
Bu hata yarım. Tam hatayı atar mısın?
 
Oyla 0
Katılım
22 Mar 2021
Konular
7
Mesajlar
33
Tepki puanı
3
Puanları
360
Bu hata yarım. Tam hatayı atar mısın?
(node:1154) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
at Client.<anonymous> (/home/runner/ghost/index.js:55:54)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (/home/runner/ghost/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/ghost/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/ghost/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/home/runner/ghost/node_modules/ws/lib/websocket.js:825:20)
(node:1154) 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:1154) [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.

1620130058675.png


Oysaki çalışıyordu ve komut hala çalışıyor.
 
Oyla 0
Katılım
10 Kas 2019
Konular
225
Mesajlar
1,057
Çözümler
19
Tepki puanı
1,049
Puanları
8,710
(node:1154) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
at Client.<anonymous> (/home/runner/ghost/index.js:55:54)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (/home/runner/ghost/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/ghost/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/ghost/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/ghost/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/home/runner/ghost/node_modules/ws/lib/websocket.js:825:20)
(node:1154) 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:1154) [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.

Ekli dosyayı görüntüle 4973

Oysaki çalışıyordu ve komut hala çalışıyor.
Hatayı farklı bir kodlamanız vermekte. Bu kodlamayla alakasız.
 
Oyla 0