diff --git a/cogs/basic.py b/cogs/basic.py index 285070e..761033b 100644 --- a/cogs/basic.py +++ b/cogs/basic.py @@ -13,14 +13,6 @@ 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.guild_only() @commands.command() async def membercount(self, ctx): @@ -28,13 +20,6 @@ class Basic: 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.""" - await ctx.send("You can find my source at " + - config.source_url + - ". Serious PRs and issues welcome!") - @commands.command(aliases=["robocopng", "robocop-ng"]) async def robocop(self, ctx): """Shows a quick embed with bot info.""" diff --git a/cogs/links.py b/cogs/links.py index 730fdfe..b1e6efd 100644 --- a/cogs/links.py +++ b/cogs/links.py @@ -1,3 +1,5 @@ +import discord +import config from discord.ext import commands @@ -44,6 +46,20 @@ class Links: "") + @commands.command() + async def source(self, ctx): + """Gives link to source code.""" + await ctx.send(f"You can find my source at {config.source_url}. " + "Serious PRs and issues welcome!") + + @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}") + def setup(bot): bot.add_cog(Links(bot)) diff --git a/cogs/mod.py b/cogs/mod.py index 0344ced..c92f116 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -370,25 +370,6 @@ class Mod: await ctx.send("Successfully set nickname.") - @commands.guild_only() - @commands.check(check_if_staff) - @commands.command() - async def userinfo(self, ctx, *, user: discord.Member): - """Gets user info, staff only.""" - role = user.top_role.name - if role == "@everyone": - role = "@ everyone" - await ctx.send(f"user = {user}\n" - f"id = {user.id}\n" - f"avatar = {user.avatar_url}\n" - f"bot = {user.bot}\n" - f"created_at = {user.created_at}\n" - f"display_name = {user.display_name}\n" - f"joined_at = {user.joined_at}\n" - f"activities = `{user.activities}`\n" - f"color = {user.colour}\n" - f"top_role = {role}\n") - @commands.guild_only() @commands.check(check_if_staff) @commands.command(aliases=['echo']) diff --git a/cogs/mod_userlog.py b/cogs/mod_userlog.py index 61b193c..414c420 100644 --- a/cogs/mod_userlog.py +++ b/cogs/mod_userlog.py @@ -191,6 +191,31 @@ class ModUserlog: else: await ctx.send(del_event) + @commands.guild_only() + @commands.check(check_if_staff) + @commands.command() + async def userinfo(self, ctx, *, user: discord.Member): + """Gets user info, staff only.""" + role = user.top_role.name + if role == "@everyone": + role = "@ everyone" + + event_types = ["warns", "bans", "kicks", "mutes", "notes"] + embed = self.get_userlog_embed_for_id(str(user.id), str(user), + event=event_types) + + await ctx.send(f"user = {user}\n" + f"id = {user.id}\n" + f"avatar = {user.avatar_url}\n" + f"bot = {user.bot}\n" + f"created_at = {user.created_at}\n" + f"display_name = {user.display_name}\n" + f"joined_at = {user.joined_at}\n" + f"activities = `{user.activities}`\n" + f"color = {user.colour}\n" + f"top_role = {role}\n", + embed=embed) + def setup(bot): bot.add_cog(ModUserlog(bot)) diff --git a/config_template.py b/config_template.py index 80fad0a..b9e0d73 100644 --- a/config_template.py +++ b/config_template.py @@ -6,7 +6,7 @@ token = "token-goes-here" bot_description = "Robocop-NG, the moderation bot of ReSwitched." source_url = "https://github.com/aveao/robocop-ng" -rules_url = "https://reswitched.team/discord/" +rules_url = "https://reswitched.team/discord/#rules" # The bot description to be used in .robocop embed embed_desc = "Robocop-NG is developed by [Ave](https://github.com/aveao)"\