commit
739b992d0b
5 changed files with 45 additions and 1 deletions
0
Procfile
Normal file
0
Procfile
Normal file
|
|
@ -1 +1,4 @@
|
||||||
# duckster
|
# Duckster
|
||||||
|
A fun and all-purpose bot made in Python.
|
||||||
|
|
||||||
|
Founded by @iakrules and @rzmk
|
||||||
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)
|
||||||
20
cogs/exampleCog.py
Normal file
20
cogs/exampleCog.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
class ExampleCog(commands.Cog):
|
||||||
|
|
||||||
|
def __init__(self, client):
|
||||||
|
self.client = client
|
||||||
|
|
||||||
|
# Events
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_ready(self):
|
||||||
|
print('Bot is online.')
|
||||||
|
|
||||||
|
# Commands
|
||||||
|
@commands.command()
|
||||||
|
async def ping(self, ctx):
|
||||||
|
await ctx.send('Pong!')
|
||||||
|
|
||||||
|
def setup(client):
|
||||||
|
client.add_cog(ExampleCog(client))
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
discord.py==1.7.2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue