mirror of
https://github.com/idanoo/discord-keyword-bot.git
synced 2024-11-22 00:21:52 +00:00
Remove debugging
This commit is contained in:
parent
001e3faa19
commit
fbbeafefe3
5
bot.py
5
bot.py
@ -25,21 +25,16 @@ class DiscordKeywordBot(discord.Client):
|
|||||||
await channel.send('test: ' + message.content)
|
await channel.send('test: ' + message.content)
|
||||||
|
|
||||||
def cache_check(msg):
|
def cache_check(msg):
|
||||||
print('Checking cache for: ' + msg)
|
|
||||||
if msg in DiscordKeywordBot.CACHE_DICT:
|
if msg in DiscordKeywordBot.CACHE_DICT:
|
||||||
""" Has been sent before.. Check TTL """
|
""" Has been sent before.. Check TTL """
|
||||||
print('Exists in cache: ' + msg)
|
|
||||||
if DiscordKeywordBot.CACHE_DICT.get(msg) <= int(time.time()):
|
if DiscordKeywordBot.CACHE_DICT.get(msg) <= int(time.time()):
|
||||||
""" TTL Expired. """
|
""" TTL Expired. """
|
||||||
print('TTL Expired for:' + msg)
|
|
||||||
DiscordKeywordBot.CACHE_DICT[msg] = (int(time.time()) + DiscordKeywordBot.CACHE_TTL)
|
DiscordKeywordBot.CACHE_DICT[msg] = (int(time.time()) + DiscordKeywordBot.CACHE_TTL)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
""" TTL Not Expired """
|
""" TTL Not Expired """
|
||||||
print('TTL Not expired: ' + msg)
|
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
print('Not in cache: ' + msg)
|
|
||||||
DiscordKeywordBot.CACHE_DICT[msg] = (int(time.time()) + DiscordKeywordBot.CACHE_TTL)
|
DiscordKeywordBot.CACHE_DICT[msg] = (int(time.time()) + DiscordKeywordBot.CACHE_TTL)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user