-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
28 lines (22 loc) · 990 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import discord
import random
import asyncio
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as {0.user}'.format(self))
channels_to_send = ["", ""] # Add the IDs of the channels you want to send messages to
while True:
for channel_id in channels_to_send:
channel = self.get_channel(int(channel_id))
if channel:
try:
random_number = ''.join(random.choice('0123456789') for _ in range(27))
await channel.send(random_number)
except Exception as e:
print(f"An error occurred while sending a message: {e}")
else:
print(f"Channel with ID {channel_id} not found.")
await asyncio.sleep(random.uniform(2, 5))
client = MyClient()
client.run('TOKEN')
#your bot token goes here