Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import discord
  2. from discord.ext.commands import AutoShardedBot, when_mentioned_or
  3. import dados
  4.  
  5. client = AutoShardedBot(command_prefix=when_mentioned_or("rt.","!!"), case_insensitive=True, shard_count=2, shard_ids=(1,2))
  6.  
  7.  
  8. @client.event
  9. async def on_ready():
  10.     print(f"[OK] - {client.user.name} ({client.user.id}) - (Status - Online)")
  11.     await client.change_presence(activity=discord.Streaming(name="digite !!help", url="https://www.twitch.tv/yuka"))
  12.  
  13.  
  14. def run_modules()
  15.  
  16.  
  17.   try:
  18.     client.remove_command('help')
  19.     for modulo in dados.modulos():
  20.       client.load_extension(modulo)
  21.     print(f"[OK] - {len(dados.modulos())} modulos carregados.")
  22.   except Exception as e:
  23.      print(f"[Erro] - O modulo {modulo} não foi carregado.\n[Erro] - {e}")  
  24.  
  25.   try:
  26.     client.run(dados.token())
  27.     print(f"[OK] - Conectado ao discord(Bot).")
  28.   except Exception as e:
  29.     print(f'[Except] - Houve um erro ao conectar discord(bot)\n[Erro] - {e}')  
  30.  
  31.  
  32. if __name__ == '__main__':
  33.     run_modules()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement