Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

episode 16 error #14

Open
fco131 opened this issue Oct 21, 2021 · 1 comment
Open

episode 16 error #14

fco131 opened this issue Oct 21, 2021 · 1 comment

Comments

@fco131
Copy link

fco131 commented Oct 21, 2021

Traceback (most recent call last):
File "main.py", line 1, in
import discord
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/init.py", line 25, in
from .client import Client
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 27, in
import asyncio
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/init.py", line 21, in
from .base_events import *
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/base_events.py", line 296
future = tasks.async(future, loop=self)
^
SyntaxError: invalid syntax

KeyboardInterrupt

@sam-march
Copy link

I don't know if its the same error, but I'm getting

Traceback (most recent call last):
  File "/home/runner/Dark-Alley-Moderation-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 185, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 93, in play
    await self.play_song(ctx, song)
  File "main.py", line 43, in play_song
    url = pafy.new(song).getbestaudio().url
AttributeError: module 'pafy' has no attribute 'new'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/Dark-Alley-Moderation-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 1183, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/Dark-Alley-Moderation-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 904, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/runner/Dark-Alley-Moderation-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 194, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'pafy' has no attribute 'new'

I've read all the docs, and they say what I've done is correct, but I don't know. Looking at yours, the error is the line future = tasks.async(future, loop=self). Async defines commands and other things like that, should you have put this inside a async command, with await?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants