Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twitchio.ext import commands
- class Bot(commands.Bot):
- def __init__(self):
- super().__init__(irc_token='XXXX', client_id='...', nick='corpstache', prefix='^',
- initial_channels=['acreium'])
- # Events don't need decorators when subclassed
- async def event_ready(self):
- print(f'Ready | {self.nick}')
- async def event_message(self, message):
- print(message.content)
- await self.handle_commands(message)
- # Commands use a different decorator
- @commands.command(name='a')
- async def a(self, ctx):
- await ctx.send(f'Hello {ctx.author.name}!')
- @commands.command(name='slow')
- async def slowI(self, ctx):
- if ctx.author.is_mod == True:
- await ctx.slow()
- @commands.command(name='sloff')
- async def slowO(self, ctx):
- if ctx.author.is_mod == True:
- await ctx.slow_off()
- bot = Bot()
- bot.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement