Wednesday, 22 March 2023

discord.js v12.5.1 direct message a user by id - not in async form

I am using this as a example in a coding class I've started, and this section is about messaging on discord. So far, I have the following code from inhoLee's question's answers:

client.once('ready', () => {
client.users.get("userid").send("test");
}

And the following is my list of dependencies, as it matters:

const Discord = require('discord.js');
const { MessageEmbed, Message } = require('discord.js');
Discord.Constants.DefaultOptions.ws.properties.$browser = 'Discord Windows';
const { keep_alive } = require('./keep_alive');
const fs = require('fs');
const config = require('./config.json');
const CatLoggr = require('cat-loggr');
const client = new Discord.Client();
const log = new CatLoggr();
var request = require('request');

also it would be preferrable if the answers were not in a async/await



from discord.js v12.5.1 direct message a user by id - not in async form

No comments:

Post a Comment