userinfo: Show userlog embed also
Also: move things around a bit
This commit is contained in:
parent
45f81c62c0
commit
297a3156bf
5 changed files with 42 additions and 35 deletions
|
@ -13,14 +13,6 @@ class Basic:
|
||||||
"""Says hello. Duh."""
|
"""Says hello. Duh."""
|
||||||
await ctx.send(f"Hello {ctx.author.mention}!")
|
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.guild_only()
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def membercount(self, ctx):
|
async def membercount(self, ctx):
|
||||||
|
@ -28,13 +20,6 @@ class Basic:
|
||||||
await ctx.send(f"{ctx.guild.name} has "
|
await ctx.send(f"{ctx.guild.name} has "
|
||||||
f"{ctx.guild.member_count} members!")
|
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"])
|
@commands.command(aliases=["robocopng", "robocop-ng"])
|
||||||
async def robocop(self, ctx):
|
async def robocop(self, ctx):
|
||||||
"""Shows a quick embed with bot info."""
|
"""Shows a quick embed with bot info."""
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import discord
|
||||||
|
import config
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +46,20 @@ class Links:
|
||||||
"<https://gbatemp.net/threads/use-atmosphere-to-"
|
"<https://gbatemp.net/threads/use-atmosphere-to-"
|
||||||
"access-full-ram-with-homebrews-without-nsp.521240/>")
|
"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):
|
def setup(bot):
|
||||||
bot.add_cog(Links(bot))
|
bot.add_cog(Links(bot))
|
||||||
|
|
19
cogs/mod.py
19
cogs/mod.py
|
@ -370,25 +370,6 @@ class Mod:
|
||||||
|
|
||||||
await ctx.send("Successfully set nickname.")
|
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.guild_only()
|
||||||
@commands.check(check_if_staff)
|
@commands.check(check_if_staff)
|
||||||
@commands.command(aliases=['echo'])
|
@commands.command(aliases=['echo'])
|
||||||
|
|
|
@ -191,6 +191,31 @@ class ModUserlog:
|
||||||
else:
|
else:
|
||||||
await ctx.send(del_event)
|
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):
|
def setup(bot):
|
||||||
bot.add_cog(ModUserlog(bot))
|
bot.add_cog(ModUserlog(bot))
|
||||||
|
|
|
@ -6,7 +6,7 @@ token = "token-goes-here"
|
||||||
bot_description = "Robocop-NG, the moderation bot of ReSwitched."
|
bot_description = "Robocop-NG, the moderation bot of ReSwitched."
|
||||||
|
|
||||||
source_url = "https://github.com/aveao/robocop-ng"
|
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
|
# The bot description to be used in .robocop embed
|
||||||
embed_desc = "Robocop-NG is developed by [Ave](https://github.com/aveao)"\
|
embed_desc = "Robocop-NG is developed by [Ave](https://github.com/aveao)"\
|
||||||
|
|
Loading…
Reference in a new issue