Ignore the discord bots server when updating stats

This commit is contained in:
Daan Boerlage 2020-12-30 23:23:40 +01:00
parent 01f0d2f43b
commit 17f62d7607
Signed by: daan
GPG key ID: FCE070E1E4956606

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using Discord.WebSocket; using Discord.WebSocket;
@ -25,7 +26,7 @@ namespace Geekbot.Bot.Handlers
_database = database; _database = database;
_season = SeasonsUtils.GetCurrentSeason(); _season = SeasonsUtils.GetCurrentSeason();
_seasonsStarted = DateTime.Now.Year == 2021; _seasonsStarted = DateTime.Now.Year == 2021;
var timer = new Timer() var timer = new Timer()
{ {
Enabled = true, Enabled = true,
@ -53,6 +54,14 @@ namespace Geekbot.Bot.Handlers
} }
var channel = (SocketGuildChannel) message.Channel; var channel = (SocketGuildChannel) message.Channel;
// ignore the discord bots server
// ToDo: create a clean solution for this...
if (channel.Guild.Id == 110373943822540800)
{
return;
}
await UpdateTotalTable(message, channel); await UpdateTotalTable(message, channel);
if (_seasonsStarted) if (_seasonsStarted)
{ {