Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import asyncio
- class MyClient(discord.Client):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- # create the background task and run it in the background
- self.bg_task = self.loop.create_task(self.my_background_task())
- async def on_ready(self):
- print('Logged in as')
- print(self.user.name)
- print(self.user.id)
- print('------')
- async def my_background_task(self):
- await self.wait_until_ready()
- arbyfat = "<@103609603291369472>"
- channel = self.get_channel() # channel ID goes here
- while not self.is_closed():
- await channel.send(arbyfat)
- await asyncio.sleep(30) # task runs every 30 seconds
- client = MyClient()
- client.run('token')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement