From 3f3147bf173b44ac6b5c5998ba5533cb0c507de2 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sun, 23 Dec 2018 16:39:26 +0300 Subject: [PATCH] Get membercount and rules commands done --- README.md | 2 +- cogs/basic.py | 15 +++++++++++++++ config.py.template | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7d6c22..f2e1bc1 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Based on https://gitlab.com/ao/dpybotbase ## TODO - [x] .py configs -- [ ] membercount command +- [x] membercount command - [ ] Verification (and reset) - [ ] Logging joins, leaves, role changes, deletes, bans, kicks - [ ] Moderation commands (ban, kick, approve, revoke, addhacker, removehacker, lock, unlock, softlock, mute, unmute, playing, botnickname, nickname, clear) diff --git a/cogs/basic.py b/cogs/basic.py index 4fde7de..6d1ed75 100644 --- a/cogs/basic.py +++ b/cogs/basic.py @@ -1,6 +1,7 @@ import time import config +import discord from discord.ext import commands @@ -13,6 +14,20 @@ class Basic: """Says hello. Duh.""" await ctx.send(f"Hello {ctx.author.mention}!") + @commands.command() + async def rules(self, ctx, *, targetuser: discord.Member = None): + """Post a link to the Rules""" + if not targetuser: + targetuser = ctx.author + await ctx.send(f"{targetuser.mention}: A link to the rules " + f"can be found here: {config.rules_url}") + + @commands.command() + async def membercount(self, ctx): + """Prints the member count of the server.""" + await ctx.send(f"{ctx.guild.name} has " + f"{ctx.guild.member_count} members!") + @commands.command() async def source(self, ctx): """Gives link to source code.""" diff --git a/config.py.template b/config.py.template index 9391688..46cab3a 100644 --- a/config.py.template +++ b/config.py.template @@ -8,6 +8,7 @@ guild_whitelist = [ ] source_url = "https://github.com/aveao/robocop-ng" +rules_url = "https://reswitched.team/discord/" bot_manager_role_id = 526372554081042462 # Bot management role in NotSwitched staff_role_ids = [526384077679624192, # Team role in NotSwitched