Guest User

Untitled

a guest
Jun 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import discord
  2. import asyncio
  3.  
  4. import bot.client.getkey as _getkey
  5. from bot.utils import get_owner
  6.  
  7. class ImABot(discord.Client):
  8. async def on_ready(self):
  9. ts = await self.create_server("test")
  10. inv = await self.create_invite(ts.default_channel)
  11. await self.send_message(get_owner()) #get owner simply gets the user who owns the bot, me.
  12. Bot = ImABot()
  13.  
  14.  
  15. Bot.run(_getkey.key())
  16.  
  17. Traceback (most recent call last):
  18. File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
  19. yield from getattr(self, event)(*args, **kwargs)
  20. File "/Users/edl/Desktop/ /Programming/Github/Democracy-Bot/demobot/client/client.py", line 22, in on_ready
  21. inv = await self.create_invite(ts.default_channel)
  22. File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 2628, in create_invite
  23. data = yield from self.http.create_invite(destination.id, **options)
  24. AttributeError: 'NoneType' object has no attribute 'id'
Add Comment
Please, Sign In to add comment