Compare commits

..

2 commits

Author SHA1 Message Date
nsde 151c9cda77 Merge branch 'main' of https://github.com/NovaOSS/nova-cord 2023-10-09 19:30:23 +02:00
nsde cafb05ac5d old changes 2023-10-09 19:30:21 +02:00
2 changed files with 2 additions and 21 deletions

View file

@ -8,7 +8,8 @@
"**/Thumbs.db": true,
"**/__pycache__": true,
"**/.vscode": true,
"**/*.map": true
"**/*.map": true,
"**/*.css.map": true
},
"hide-files.files": []
}

View file

@ -128,29 +128,9 @@ async def music(interaction: nextcord.Interaction):
async def resetkey(interaction: nextcord.Interaction):
return await accounts.reset_key(interaction)
async def status_update():
guild = bot.get_guild(int(os.getenv('DISCORD_GUILD')))
members = guild.members
await bot.change_presence(
activity=nextcord.Activity(
type=nextcord.ActivityType.watching,
name=f'{len(members)} members'
)
)
async def loop_status_update():
while True:
await status_update()
await nextcord.utils.sleep_until(datetime.datetime.now() + datetime.timedelta(minutes=1))
@bot.event
async def on_ready():
print(f'Online as {bot.user} (ID: {bot.user.id})')
await api.start(bot)
# display status as watching + discord guild member count and update every minute
bot.loop.create_task(loop_status_update())
bot.run(os.getenv('DISCORD_TOKEN'))