Update code naar 2.0 versie van discordpy #17

Merged
jp merged 6 commits from 2.0-update into master 2022-11-02 22:25:26 +01:00
Showing only changes of commit 9665a52d23 - Show all commits
+4 -4
View File
@@ -207,7 +207,7 @@ class Chatbot(commands.Cog):
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()
msg = yield from anext(messageIterator)
allMessages.append(msg)
i = 0
@@ -256,10 +256,10 @@ class Chatbot(commands.Cog):
#Get previous message to respond to
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()
messageToRespondTo = yield from anext(messageIterator) #this will be the !reageer command. skip
messageToRespondTo = yield from anext(messageIterator)
if messageToRespondTo.content.strip()[0] == '!' or messageToRespondTo.author.bot: #another chance
messageToRespondTo = yield from messageIterator.next() #but it's not a huge problem if he responds to himself
messageToRespondTo = yield from anext(messageIterator) #but it's not a huge problem if he responds to himself
if messageToRespondTo.content.strip()[0] == '!':
wordsToRespondTo = []
else: