Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- from discord.ext.commands import Bot
- import sys, traceback, random, logging
- logging.basicConfig(level=logging.INFO)
- FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
- logging.basicConfig(format=FORMAT)
- d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
- logger = logging.getLogger('tcpserver')
- logger.warning('Protocol problem: %s', 'connection reset', extra=d)
- bot = Bot(command_prefix="$")
- startup_extensions = ["scores"]
- @bot.event
- async def on_ready():
- print('Logged in as:')
- print(bot.user.name + "#" + bot.user.discriminator)
- print(bot.user.id)
- print("-------------")
- if __name__ == '__main__':
- for extension in cogs:
- try:
- bot.load_extension(extension)
- except Exception as e:
- print(f"Failed to load {extension}.", file=sys.stderr)
- traceback.print_exc()
- bot.run("mytoken")
- _______________________________________________________________________________________________________________________________________
- from discord.ext import commands
- class Scores:
- def init(self, bot):
- self.bot = bot
- @commands.command(name="stats")
- async def assign_scores(self, ctx):
- await ctx.send("Enter your strength score here with $score scorehere")
- def setup(bot):
- bot.add_cog(Test(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement