Better Framework, new cog-files
This commit is contained in:
@@ -6,6 +6,14 @@
|
||||
# "load", "unload", "reload"
|
||||
# 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
|
||||
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
|
||||
#
|
||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
#
|
||||
"""
|
||||
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
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# A Cog that add some general commands
|
||||
#
|
||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
#
|
||||
"""
|
||||
Some general commands
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
@@ -29,24 +29,6 @@ class General(commands.Cog):
|
||||
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
|
||||
def setup(bot):
|
||||
bot.add_cog(General(bot))
|
||||
12
cogs/help.py
12
cogs/help.py
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# Cog for a custom Help Command
|
||||
#
|
||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
#
|
||||
"""
|
||||
Some help for the users
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
"""
|
||||
|
||||
# IMPORTS - exter
|
||||
import discord
|
||||
@@ -23,7 +23,7 @@ class Help(commands.Cog):
|
||||
I'm the usele... divine AquaBot!
|
||||
If you need help, try using the `help` command!
|
||||
"""
|
||||
|
||||
|
||||
await ctx.send(response)
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# This Cog adds some utility commands
|
||||
#
|
||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
#
|
||||
"""
|
||||
Some nice utility
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
@@ -24,6 +24,24 @@ class Utility(commands.Cog):
|
||||
link = "Here is our invite link: https://discordapp.com/invite/HbYfyJT"
|
||||
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
|
||||
def setup(bot):
|
||||
bot.add_cog(Utility(bot))
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#
|
||||
# A Cog thats deals with welcoming new users etc.
|
||||
#
|
||||
# https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
#
|
||||
"""
|
||||
Welcoming new users etc.
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
"""
|
||||
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
|
||||
Reference in New Issue
Block a user