Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit 13720436e3d69cb62afa471780951f83b2120cc2
parent 9203b0af02fa08b79d471d3944bf3df68c93a7b2
Author: Demonstrandum <moi@knutsen.co>
Date:   Mon, 23 Mar 2020 01:59:45 +0000

Get guild.id from channel.

Diffstat:
Mlib/main.ts | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/main.ts b/lib/main.ts @@ -285,8 +285,8 @@ export class SimpOMatic { } async last_message(opts) : Promise<string> { - const CONFIG = GLOBAL_CONFIG.guilds[opts.guild.id]; const channel = opts.channel as TextChannel; + const CONFIG = GLOBAL_CONFIG.guilds[channel.guild.id]; if (!opts.offset) opts.offset = 1; if (opts.mention) opts.mentioning = opts.mentioning.trim(); @@ -333,7 +333,6 @@ export class SimpOMatic { expansions[i] = await this.last_message({ command: true, channel: message.channel, - guild: message.guild }); continue; } @@ -350,7 +349,7 @@ export class SimpOMatic { command: !opts.includes('^'), mention, mentioning, offset: offset || 1, - channel: message.channel + channel: message.channel, }); } }