Fixes discordpy breaking change in chatbot

This commit is contained in:
Mark Hoekveen
2020-05-25 12:31:19 +02:00
parent 70392bed44
commit d12289b2a6
+3 -3
View File
@@ -190,7 +190,7 @@ class Chatbot(commands.Cog):
wordDict = np.load('markov_dict.npy').item()
#Iterate through the last x messages from the channel:
messageIterator = channel.history(limit=nrOfMessages, before=None, after=None, reverse=False, around=None)
messageIterator = channel.history(limit=nrOfMessages, before=None, after=None, oldest_first=False, around=None)
allMessages = []
for i in range(nrOfMessages):
msg = yield from messageIterator.next()
@@ -241,7 +241,7 @@ class Chatbot(commands.Cog):
"""
#Get previous message to respond to
messageIterator = ctx.channel.history(limit=3, before=None, after=None, reverse=False, around=None)
messageIterator = ctx.channel.history(limit=3, before=None, after=None, oldest_first=False, around=None)
messageToRespondTo = yield from messageIterator.next() #this will be the !reageer command. skip
messageToRespondTo = yield from messageIterator.next()
if messageToRespondTo.content.strip()[0] == '!' or messageToRespondTo.author.bot: #another chance
@@ -439,4 +439,4 @@ class Chatbot(commands.Cog):
message += uitspraken[i]
yield from ctx.channel.send(message)
except:
pass
pass