-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcore.py
More file actions
38 lines (28 loc) · 952 Bytes
/
core.py
File metadata and controls
38 lines (28 loc) · 952 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
30
31
32
33
34
35
36
37
38
import discord
import os
from discord.ext import commands, tasks
from itertools import cycle
import re
client = commands.Bot(command_prefix = '.')
status = cycle(['NACL', 'Developing with NACL Group'])
@client.event
async def on_ready():
change_status.start()
@tasks.loop(seconds=10)
async def change_status():
await client.change_presence(status=discord.Status.online,activity=discord.Game(next(status)))
@client.command()
async def load(ctx, extension):
client.load_extension(f'cogs.{extension}')
@client.command()
async def unload(ctx, extension):
client.unload_extension(f'cogs.{extension}')
@client.command()
async def reload(ctx, extension):
client.unload_extension(f'cogs.{extension}')
client.load_extension(f'cogs.{extension}')
await ctx.send('Reloaded')
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}')
client.run('TOKEN HERE')