Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

commit - #11

Open
almightyfoon wants to merge 1 commit into
LarnuUK:masterfrom
almightyfoon:memefix
Open

commit#11
almightyfoon wants to merge 1 commit into
LarnuUK:masterfrom
almightyfoon:memefix

Conversation

@almightyfoon

Copy link
Copy Markdown

turned the meme check into a function, also renamed the image files to be their appropriate meme keyword.

@LarnuUK LarnuUK assigned LarnuUK and unassigned LarnuUK May 20, 2020
@LarnuUK
LarnuUK self-requested a review May 20, 2020 21:34
@LarnuUK

LarnuUK commented May 20, 2020

Copy link
Copy Markdown
Owner

Will give this a quick test in the morning. Thanks. :)

@LarnuUK LarnuUK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested, but should have noticed, this doesn't work. You have a call to message.channel.send using await, which is an asyncronous function, however, it's declared inside a syncronous definition; meaning that trying to run gives you the error:

File "~\dolphinbot\dolphinbot.py", line 62
await message.channel.send(file=discord.File(image))
^
SyntaxError: 'await' outside async function

Changing the definition to async returns the below:

~\dolphinbot\dolphinbot.py:1047: RuntimeWarning: coroutine 'meme_commands' was never awaited
meme_commands()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Won't lie, this stuff goes past me. Might be better to pass back values with the function, and then await message.channel.send in on_message?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants