This commit is contained in:
Lamp 2021-12-02 11:59:57 -08:00
parent 4821faef3b
commit 028395b9b2

@ -6,14 +6,20 @@ var client = module.exports = new Discord.Client({
intents: 32767 //all
});
client.login(config.token).then(async () => {
console.log("ready");
(await client.channels.fetch(config.bot_channel))?.send('a');
});
// small misc stuff here
/* small misc stuff here */
////////////////////////////////////////////////////////////////////////////////////////
client.on("guildMemberAdd", member => {
if (member.guild.id != config.guild) return;
// add role
member.roles.add(member.user.bot ? config.bot_role : config.human_role);
// join message
client.channels.resolve(config.default_channel)?.send(random([
`${member.user.username} join`,
`${member.user.username} joined`,
@ -23,17 +29,24 @@ client.on("guildMemberAdd", member => {
});
client.on("guildMemberRemove", member => {
if (member.guild.id != config.guild) return;
// leave message
client.channels.resolve(config.default_channel)?.send(random([
`${member.user.username} left`,
`${member.user.username} disappear`,
`${member.user.username.toLowerCase()} gone`
]));
});
client.on("messageCreate", message => {
// comment thread on announcements
message.channel.id == config.announcement_channel && message.startThread({name: "Comments"});
// stupid m bot
message.author.id == "732072478519722096" && message.content.endsWith("is bad letter m is much better") && message.delete();
});
// add reactions to video and audio
{
let a = async m => {
if (m.guild?.id != config.guild) return;
@ -50,10 +63,3 @@ client.on("messageCreate", message => {
client.on("messageUpdate", (r, q) => a(q));
}
client.login(config.token).then(async () => {
console.log("ready");
(await client.channels.fetch(config.bot_channel))?.send('a');
});