-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (25 loc) · 912 Bytes
/
main.py
File metadata and controls
29 lines (25 loc) · 912 Bytes
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
29
from discord.ext import tasks, commands
import discord
import asyncio
from discord.ext.commands import Bot
from discord.ext.commands import Context
# Just add your desired prefix there.
bot = commands.Bot(command_prefix='!')
#Bot status
@bot.event
async def on_ready(): # This function is run upon the bots startup completing
# os.system('cls')
print("Name: {}".format(bot.user.name))
print("ID: {}".format(bot.user.id))
print("Status: Running")
print("########################################")
#REFREST STATUS MSG
@tasks.loop(seconds=18000)
async def status_task() -> None:
members = 0
for guild in bot.guilds:
members += guild.member_count - 0
await bot.change_presence(activity = discord.Activity(type = discord.ActivityType.watching, name = f'{members} Members'))
await asyncio.sleep(18000)
#BOT TOKEN
bot.run('YOUR TOKEN HERE')