generated from EliasSchaut/DiscordBotTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
41 changed files
with
316 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { get_text: gt } = require("../../lang/lang_helper") | ||
const s = "commands.mensa_disable." | ||
|
||
module.exports = { | ||
name: 'mensa_disable', | ||
description: async function (msg) { return await gt(msg, s + "help") }, | ||
aliases: ['md', 'mensad', 'mensadisable', "mensa_d", "mensa_dis"], | ||
args_needed: false, | ||
args_min_length: 0, | ||
args_max_length: 0, | ||
guild_only: true, | ||
need_permission: ['ADMINISTRATOR'], | ||
disabled: false, | ||
enable_slash: false, | ||
async execute(msg, args) { | ||
await msg.client.DB.Guild.set_mensa_disable(msg.client, msg.member.guild.id) | ||
await msg.client.output.send(msg, await gt(msg, s + "success")) | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { get_text: gt } = require("../../lang/lang_helper") | ||
const s = "commands.mensa_enable." | ||
|
||
module.exports = { | ||
name: 'mensa_enable', | ||
description: async function (msg) { return await gt(msg, s + "help") }, | ||
aliases: ['me', 'mensae', 'mensaenable', "mensa_e"], | ||
args_needed: false, | ||
args_min_length: 0, | ||
args_max_length: 0, | ||
guild_only: true, | ||
need_permission: ['ADMINISTRATOR'], | ||
disabled: false, | ||
enable_slash: false, | ||
async execute(msg, args) { | ||
if (!await msg.client.DB.Guild.get_mensa_channel_id(msg.client, msg.member.guild.id)) { | ||
await msg.client.output.reply(msg, await gt(msg, s + "fail.channel_not_set")) | ||
return | ||
} | ||
|
||
await msg.client.DB.Guild.set_mensa_enable(msg.client, msg.member.guild.id) | ||
await msg.client.output.send(msg, await gt(msg, s + "success")) | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { get_text: gt } = require("../../lang/lang_helper") | ||
const s = "commands.mensa_set_channel." | ||
|
||
module.exports = { | ||
name: 'mensa_set_channel', | ||
description: async function (msg) { return await gt(msg, s + "help") }, | ||
aliases: ['ms', 'mset', 'msc', 'mensas', 'mensa_set', 'mensaset'], | ||
args_needed: true, | ||
args_min_length: 1, | ||
args_max_length: 1, | ||
usage: async function (msg) { return await gt(msg, s + "usage") }, | ||
guild_only: true, | ||
need_permission: ['ADMINISTRATOR'], | ||
disabled: false, | ||
enable_slash: false, | ||
async execute(msg, args) { | ||
const new_mensa_channel_id = args[0] | ||
|
||
// args is a number | ||
if (new_mensa_channel_id.match(/[^0-9]/)) { | ||
await msg.client.output.reply(msg, await gt(msg, s + "fail.no_number")) | ||
return | ||
} | ||
|
||
// channel exists in same guild# | ||
let channel | ||
try { | ||
channel = await msg.guild.channels.fetch(new_mensa_channel_id) | ||
|
||
} catch (e) { | ||
await msg.client.output.reply(msg, await gt(msg, s + "fail.wrong_id")) | ||
return | ||
} | ||
|
||
await msg.client.DB.Guild.set_mensa_channel_id(msg.client, msg.member.guild.id, new_mensa_channel_id) | ||
await msg.client.output.send(msg, await gt(msg, s + "success")) | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
js/event_helper/command_event.js → handler/event_handler/command_event.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// event_helper fields | ||
// event_handler fields | ||
const s = "command_create." | ||
|
||
// --------------------------------- | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.