initial bot setup
This commit is contained in:
parent
3f8135b81e
commit
91cb11d20e
5 changed files with 45 additions and 1 deletions
20
bot.py
Normal file
20
bot.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import os
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
TOKEN = os.environ.get("TOKEN")
|
||||
client = commands.Bot(command_prefix= 'd!')
|
||||
|
||||
@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}')
|
||||
|
||||
for filename in os.listdir('./cogs'):
|
||||
if filename.endswith('.py'):
|
||||
client.load_extension(f'cogs.{filename[:-3]}')
|
||||
|
||||
client.run(TOKEN)
|
||||
Loading…
Add table
Add a link
Reference in a new issue