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
+2 -2
View File
@@ -190,7 +190,7 @@ class Chatbot(commands.Cog):
wordDict = np.load('markov_dict.npy').item() wordDict = np.load('markov_dict.npy').item()
#Iterate through the last x messages from the channel: #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 = [] allMessages = []
for i in range(nrOfMessages): for i in range(nrOfMessages):
msg = yield from messageIterator.next() msg = yield from messageIterator.next()
@@ -241,7 +241,7 @@ class Chatbot(commands.Cog):
""" """
#Get previous message to respond to #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() #this will be the !reageer command. skip
messageToRespondTo = yield from messageIterator.next() messageToRespondTo = yield from messageIterator.next()
if messageToRespondTo.content.strip()[0] == '!' or messageToRespondTo.author.bot: #another chance if messageToRespondTo.content.strip()[0] == '!' or messageToRespondTo.author.bot: #another chance