Created
June 18, 2018 17:38
-
-
Save LucasCoderT/fe87a14789411e2c7e7319d2efd9d55a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import discord | |
client = discord.Client() | |
async def my_background_task(): | |
await client.wait_until_ready() | |
counter = 0 | |
channel = client.get_channel(123456) # channel ID goes here | |
while not client.is_closed(): | |
counter += 1 | |
await channel.send(counter) | |
await asyncio.sleep(60) # task runs every 60 seconds | |
client.loop.create_task(my_background_task()) | |
client.run("token") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment