Skip to content

Commit

Permalink
"fixed msg set"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jun 21, 2021
1 parent 198ab5d commit 3fd3ecd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/commands-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ export default class CommandsController {
* @param msgToBeSet the message to be set.
*/
private async setSendMsg(message: Message, msgToBeSet: string[]): Promise<void> {
let msg = "";
for (const word of msgToBeSet) msg += word;
if (!checkIfUserIsAdmin(message)) return;
const server = await this.databaseController.findByServerId(message.guild.id);
if (server.channelId) {
await this.databaseController.setSendMsg(message.guild.id, msgToBeSet[0]);
await this.databaseController.setSendMsg(message.guild.id, msg);
await message.channel.send("Your message is set :)");
} else { // no channel specified
await message.channel.send(":interrobang:Please specify a channel first with `!dimg channel nameOfYourChannel`");
Expand Down

0 comments on commit 3fd3ecd

Please sign in to comment.