Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import asyncio
- import bot.client.getkey as _getkey
- from bot.utils import get_owner
- class ImABot(discord.Client):
- async def on_ready(self):
- ts = await self.create_server("test")
- inv = await self.create_invite(ts.default_channel)
- await self.send_message(get_owner()) #get owner simply gets the user who owns the bot, me.
- Bot = ImABot()
- Bot.run(_getkey.key())
- Traceback (most recent call last):
- File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
- yield from getattr(self, event)(*args, **kwargs)
- File "/Users/edl/Desktop/ /Programming/Github/Democracy-Bot/demobot/client/client.py", line 22, in on_ready
- inv = await self.create_invite(ts.default_channel)
- File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 2628, in create_invite
- data = yield from self.http.create_invite(destination.id, **options)
- AttributeError: 'NoneType' object has no attribute 'id'
Add Comment
Please, Sign In to add comment