Sending private messages to user

后端 未结 8 1539
清歌不尽
清歌不尽 2020-12-14 18:39

I\'m using the discord.js library and node.js to create a Discord bot that facilitates poker. It is functional except the hands are shown to everyone, and I need to loop thr

8条回答
  •  醉酒成梦
    2020-12-14 19:10

    A simple way would be to do something like:

    const channel = client.channels.cache.get("CHANNEL_ID");
    channel.send("Hello");
    

    Channel Name

    const channel = client.channels.cache.get((channel) => channel.name == "CHANNEL_NAME");
    channel.send("Hello");
    

    Channel ID

    const channel = client.channels.cache.get((channel) => channel.id == "CHANNEL_ID");
    channel.send("Hello");
    

提交回复
热议问题