Better Framework, new cog-files
This commit is contained in:
@@ -29,8 +29,8 @@ The following commands assume that `.` is your default prefix.
|
|||||||
There are currently two command, which help the user to naviagte the bot's
|
There are currently two command, which help the user to naviagte the bot's
|
||||||
commands:
|
commands:
|
||||||
|
|
||||||
`.aquabot` shows a short introduction
|
+ `.aquabot` shows a short introduction
|
||||||
`.help` shows a list of all commands (A custom help message is WIP)
|
+ `.help` shows a list of all commands (A custom help message is WIP)
|
||||||
|
|
||||||
Config
|
Config
|
||||||
------
|
------
|
||||||
|
|||||||
11
aquabot.py
11
aquabot.py
@@ -1,10 +1,9 @@
|
|||||||
#################################
|
"""
|
||||||
### AquaBot created by Marc ###
|
AquaBot created by Marc.
|
||||||
### Aqua Best Girl! ###
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# This project uses discordpy
|
This project uses discordpy:
|
||||||
# https://discordpy.readthedocs.io/en/latest/intro.html
|
https://discordpy.readthedocs.io/en/latest/intro.html
|
||||||
|
"""
|
||||||
|
|
||||||
# IMPORTS - external
|
# IMPORTS - external
|
||||||
import discord
|
import discord
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
# "load", "unload", "reload"
|
# "load", "unload", "reload"
|
||||||
# https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
|
# https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
|
||||||
#
|
#
|
||||||
|
"""
|
||||||
|
Admin commands, that can be used from within the chat
|
||||||
|
|
||||||
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
|
|
||||||
|
"load", "unload", "reload"
|
||||||
|
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
|
||||||
|
"""
|
||||||
|
|
||||||
# IMPORTS
|
# IMPORTS
|
||||||
import discord
|
import discord
|
||||||
|
|||||||
20
cogs/anime.py
Normal file
20
cogs/anime.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
"""
|
||||||
|
Some anime-related commands
|
||||||
|
|
||||||
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
|
"""
|
||||||
|
|
||||||
|
# IMPORTS
|
||||||
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
# COG INIT
|
||||||
|
class Adnime(commands.Cog):
|
||||||
|
def __init__(self, bot):
|
||||||
|
self.bot = bot
|
||||||
|
|
||||||
|
# COG BODY
|
||||||
|
|
||||||
|
# COG ENDING
|
||||||
|
def setup(bot):
|
||||||
|
bot.add_cog(Adnime(bot))
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#
|
"""
|
||||||
# foo
|
This framework can be used to create new Cogs, remember to add them in the config
|
||||||
#
|
|
||||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
#
|
"""
|
||||||
|
|
||||||
# IMPORTS
|
# IMPORTS
|
||||||
import discord
|
import discord
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#
|
"""
|
||||||
# A Cog that add some general commands
|
Some general commands
|
||||||
#
|
|
||||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
#
|
"""
|
||||||
|
|
||||||
# IMPORTS - external
|
# IMPORTS - external
|
||||||
import discord
|
import discord
|
||||||
@@ -29,24 +29,6 @@ class General(commands.Cog):
|
|||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@commands.command(name="pat")
|
|
||||||
@commands.guild_only()
|
|
||||||
async def pat(self, ctx, target: str):
|
|
||||||
"""
|
|
||||||
Let's you pat a selected user
|
|
||||||
"""
|
|
||||||
author = ctx.message.author
|
|
||||||
if target is None:
|
|
||||||
response = "No one to pat..."
|
|
||||||
elif target.capitalize() == "Noel":
|
|
||||||
response = "NNN-GYAAAA!"
|
|
||||||
else:
|
|
||||||
response = f"{target} got pat by {author.mention}"
|
|
||||||
|
|
||||||
await ctx.send(response)
|
|
||||||
|
|
||||||
|
|
||||||
# COG ENDING
|
# COG ENDING
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(General(bot))
|
bot.add_cog(General(bot))
|
||||||
10
cogs/help.py
10
cogs/help.py
@@ -1,8 +1,8 @@
|
|||||||
#
|
"""
|
||||||
# Cog for a custom Help Command
|
Some help for the users
|
||||||
#
|
|
||||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
#
|
"""
|
||||||
|
|
||||||
# IMPORTS - exter
|
# IMPORTS - exter
|
||||||
import discord
|
import discord
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#
|
"""
|
||||||
# This Cog adds some utility commands
|
Some nice utility
|
||||||
#
|
|
||||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
#
|
"""
|
||||||
|
|
||||||
# IMPORTS
|
# IMPORTS
|
||||||
import discord
|
import discord
|
||||||
@@ -24,6 +24,24 @@ class Utility(commands.Cog):
|
|||||||
link = "Here is our invite link: https://discordapp.com/invite/HbYfyJT"
|
link = "Here is our invite link: https://discordapp.com/invite/HbYfyJT"
|
||||||
await ctx.send(link)
|
await ctx.send(link)
|
||||||
|
|
||||||
|
|
||||||
|
@commands.command(name="pat")
|
||||||
|
@commands.guild_only()
|
||||||
|
async def pat(self, ctx, target: str):
|
||||||
|
"""
|
||||||
|
Let's you pat a selected user
|
||||||
|
"""
|
||||||
|
author = ctx.message.author
|
||||||
|
if target is None:
|
||||||
|
response = "No one to pat..."
|
||||||
|
elif target.capitalize() == "Noel":
|
||||||
|
response = "NNN-GYAAAA!"
|
||||||
|
else:
|
||||||
|
response = f"{target} got pat by {author.mention}"
|
||||||
|
|
||||||
|
await ctx.send(response)
|
||||||
|
|
||||||
|
|
||||||
# COG ENDING
|
# COG ENDING
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Utility(bot))
|
bot.add_cog(Utility(bot))
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
#
|
"""
|
||||||
# A Cog thats deals with welcoming new users etc.
|
Welcoming new users etc.
|
||||||
#
|
|
||||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||||
#
|
"""
|
||||||
|
|
||||||
|
|
||||||
# IMPORTS
|
# IMPORTS
|
||||||
import discord
|
import discord
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
# Initally loaded cogs
|
"""
|
||||||
# Don't remove the "admin" cog or tou won't be able to load cogs
|
Initally loaded cogs
|
||||||
# from with the Discord-Client
|
Don't remove the "admin" cog or tou won't be able to load cogs
|
||||||
|
from with the Discord-Client
|
||||||
|
"""
|
||||||
|
|
||||||
__cogs__ = [
|
__cogs__ = [
|
||||||
"cogs.admin",
|
"cogs.admin",
|
||||||
"cogs.general",
|
"cogs.general",
|
||||||
"cogs.welcome",
|
"cogs.welcome",
|
||||||
"cogs.help",
|
"cogs.help",
|
||||||
"cogs.utility"
|
"cogs.utility",
|
||||||
|
"cogs.anime"
|
||||||
]
|
]
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
# Gather all config data into one file
|
"""
|
||||||
# loadconfig.py then gets called in aquabot.py
|
Gather all config data into one file
|
||||||
|
|
||||||
|
loadconfig.py then gets called in aquabot.py
|
||||||
|
"""
|
||||||
|
|
||||||
from config.cogs import __cogs__
|
from config.cogs import __cogs__
|
||||||
|
|
||||||
from config.config import __token__, __prefix__
|
from config.config import __token__, __prefix__
|
||||||
|
|||||||
Reference in New Issue
Block a user