From 52ef8cfe934eb3bad4687be57f5a195bda1093f3 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sun, 23 Dec 2018 16:48:15 +0300 Subject: [PATCH] Add links and meme cogs Now it's time to implement big stuffs :) --- README.md | 2 +- Robocop.py | 4 +++- cogs/links.py | 19 +++++++++++++++++++ cogs/meme.py | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 cogs/links.py create mode 100644 cogs/meme.py diff --git a/README.md b/README.md index f2e1bc1..7e9fec8 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Based on https://gitlab.com/ao/dpybotbase - [ ] Moderation commands (ban, kick, approve, revoke, addhacker, removehacker, lock, unlock, softlock, mute, unmute, playing, botnickname, nickname, clear) - [ ] Warns system (warn, delwarn, listwarns, clearwarns, clearwarnsid, listwarnsid, delwarnid) - [ ] User notes -- [ ] Meme commands and pegaswitch (honestly the easiest part) +- [x] Meme commands and pegaswitch (honestly the easiest part) - [ ] .serr and .err - [x] source command - [ ] robocop command diff --git a/Robocop.py b/Robocop.py index 683b283..ec728e2 100755 --- a/Robocop.py +++ b/Robocop.py @@ -40,7 +40,9 @@ def get_prefix(bot, message): initial_extensions = ['cogs.common', 'cogs.admin', - 'cogs.basic'] + 'cogs.basic', + 'cogs.links', + 'cogs.meme'] bot = commands.Bot(command_prefix=get_prefix, description=config.bot_description, pm_help=None) diff --git a/cogs/links.py b/cogs/links.py new file mode 100644 index 0000000..77104f5 --- /dev/null +++ b/cogs/links.py @@ -0,0 +1,19 @@ +from discord.ext import commands + + +class Links: + """ + Commands for easily linking to projects. + """ + + def __init__(self, bot): + self.bot = bot + + @commands.command(hidden=True) + async def pegaswitch(self, ctx): + """test""" + await ctx.send("https://github.com/reswitched/pegaswitch") + + +def setup(bot): + bot.add_cog(Links(bot)) diff --git a/cogs/meme.py b/cogs/meme.py new file mode 100644 index 0000000..f636591 --- /dev/null +++ b/cogs/meme.py @@ -0,0 +1,40 @@ +import random +import config +import discord +from discord.ext import commands + + +class Meme: + """ + Meme commands. + """ + + def __init__(self, bot): + self.bot = bot + + def check_if_staff_or_ot(ctx): + is_ot = (ctx.channel.name == "off-topic") + is_staff = any(r.id in config.staff_role_ids for r in ctx.author.roles) + return (is_ot or is_staff) + + @commands.check(check_if_staff_or_ot) + @commands.command(hidden=True, name="bam") + async def bam_member(self, ctx, user: discord.Member): + """Bams a user owo""" + await ctx.send(f"{self.bot.escape_name(user)} is ̶n͢ow b̕&̡.̷ 👍̡") + + @commands.check(check_if_staff_or_ot) + @commands.command(hidden=True, name="warm") + async def warm_member(self, ctx, user: discord.Member): + """Warms a user :3""" + await ctx.send(f"{user.mention} warmed." + f" User is now {random.randint(0, 100)}°C.") + + @commands.command(hidden=True) + async def frolics(self, ctx): + """test""" + await ctx.send("https://www.youtube.com/watch?v=VmarNEsjpDI") + + +def setup(bot): + bot.add_cog(Meme(bot))