Advertisement
thatguy2

DW Bot

Feb 24th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. from discord.ext.commands import Bot
  4. import sys, traceback, random, logging
  5. logging.basicConfig(level=logging.INFO)
  6. FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
  7. logging.basicConfig(format=FORMAT)
  8. d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
  9. logger = logging.getLogger('tcpserver')
  10. logger.warning('Protocol problem: %s', 'connection reset', extra=d)
  11. bot = Bot(command_prefix="$")
  12.  
  13. startup_extensions = ["scores"]
  14.  
  15. @bot.event
  16. async def on_ready():
  17.     print('Logged in as:')
  18.     print(bot.user.name + "#" + bot.user.discriminator)
  19.     print(bot.user.id)
  20.     print("-------------")
  21.  
  22.     if __name__ == '__main__':
  23.         for extension in cogs:
  24.             try:
  25.                 bot.load_extension(extension)
  26.             except Exception as e:
  27.                 print(f"Failed to load {extension}.", file=sys.stderr)
  28.                 traceback.print_exc()
  29.  
  30. bot.run("mytoken")
  31. _______________________________________________________________________________________________________________________________________
  32. from discord.ext import commands
  33.  
  34. class Scores:
  35.     def init(self, bot):
  36.         self.bot = bot
  37.  
  38.     @commands.command(name="stats")
  39.     async def assign_scores(self, ctx):
  40.         await ctx.send("Enter your strength score here with $score scorehere")
  41.  
  42. def setup(bot):
  43.     bot.add_cog(Test(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement