userinfo: Show userlog embed also

Also: move things around a bit
This commit is contained in:
Ave Ozkal 2019-01-15 04:48:23 +03:00
parent 45f81c62c0
commit 297a3156bf
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
5 changed files with 42 additions and 35 deletions

View file

@ -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."""

View file

@ -1,3 +1,5 @@
import discord
import config
from discord.ext import commands
@ -44,6 +46,20 @@ class Links:
"<https://gbatemp.net/threads/use-atmosphere-to-"
"access-full-ram-with-homebrews-without-nsp.521240/>")
@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))

View file

@ -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'])

View file

@ -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))

View file

@ -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)"\