Eris Functions
The <Client>
in the following examples would be bot
, if you followed the first few sections.
Editing your bot's status
You have probably seen users change statuses on Discord. Well, bots can, too!
There are a few Discord statuses:
(Source: How to Geekopen in new window)
You can edit the bot status by using the following:
<Client>.editStatus('dnd');
A list of statuses:
- DnD
- Online
- Idle
- Invisible
Get a member
const guild = message.channel.guild; // get the guild object
const member = guild.members.get('<UserID>');
Edit a member
const options = {
nick: 'simp',
deaf: true,
};
const reason = 'For being a jerk';
<Member>.edit(options, reason);
DM Someone
const channel = <Client>.getDMChannel('<UserID>');
channel.createMessage('This is a DM!');
Create channel
const options = { // NOTE: Every option is optional
nsfw: false,
bitrate: 64, // Voice Channel only
reason: 'For fun',
rateLimitPerUser: 5, // slowmode, in seconds
}
<Client>.createChannel('<GuildID>', '<ChannelName>', '<ChannelType>', options);
// Channel type: 0 (text), 2 (voice), 4 (category), 5 (news), 6 (store), or 13 (stage)
Edit a text channel
const options = {
name: 'Edited Channel',
rateLimitPerUser: 5, // slow mode in seconds
nsfw: false,
};
const channel = message.channel;
channel.edit(options, 'The channel was wrong');
Copyright © Dusty 2021 - 2021