1

I'm trying to make my first cog work, but every time i try to run the program i get this error:

Traceback (most recent call last):
  File "D:\Sebi\Desktop\Servant (Discord Bot)\bot file.py", line 1, in <module>
    import discord
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\client.py", line 28, in <module>
    from .user import User
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\user.py", line 27, in <module>
    from .utils import snowflake_time
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\utils.py", line 31, in <module>
    import asyncio
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\asyncio\__init__.py", line 21, in <module>
    from .base_events import *
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 17, in <module>
    import concurrent.futures
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\__init__.py", line 17, in <module>
    from concurrent.futures.process import ProcessPoolExecutor
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\process.py", line 55, in <module>
    from multiprocessing.connection import wait
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\multiprocessing\connection.py", line 18, in <module>
    import tempfile
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\tempfile.py", line 45, in <module>
    from random import Random as _Random
  File "D:\Sebi\Desktop\Servant (Discord Bot)\random.py", line 1, in <module>
    from discord.ext import commands
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\__init__.py", line 13, in <module>
    from .bot import Bot, when_mentioned, when_mentioned_or
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 35, in <module>
    from .core import GroupMixin, Command, command
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 35, in <module>
    from . import converter as converters
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\converter.py", line 164, in <module>
    class InviteConverter(Converter):
  File "C:\Users\Sebi\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\converter.py", line 165, in InviteConverter
    @asyncio.coroutine
AttributeError: module 'asyncio' has no attribute 'coroutine'

I read on other questions that this is usually solved by upgrading to python 3.5 ( which im already on) and then clearing the py cache. It still gives me the same error. Here is my code for the cog:

from discord.ext import commands


class Public(object):
    def __init__(self,client):
        self.client = client

    @commands.command()
    async def ping(self,ctx):
        await ctx.send("Pong")

def setup(client):
    client.add_cog(Public(client))
Klaus D.
  • 13,874
  • 5
  • 41
  • 48

0 Answers0