-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathutils.js
23 lines (17 loc) · 796 Bytes
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module.exports = {
/** @returns {import("discord.js").TextChannel} */
getLogChannel(guild, db) {
if (!guild?.id) {throw new Error(`Parameter ${guild ? guild : 'null'} is not valid`);}
if (!db) {throw new Error(`Parameter ${db ? db : 'null'} is not valid`);}
const getModLogChannel = db.get('loggingchannel_' + guild.id);
const modLogChannel = guild.channels.cache.get(getModLogChannel);
return modLogChannel;
},
getWelcomeChannel(guild, db) {
if (!guild?.id) {throw new Error(`Parameter ${guild ? guild : 'null'} is not valid`);}
if (!db) {throw new Error(`Parameter ${db ? db : 'null'} is not valid`);}
const getWelcomeChannel = db.get('welcomechannel_' + guild.id);
const welcomeChannel = guild.channels.cache.get(getWelcomeChannel);
return welcomeChannel;
},
};