Add userinfo, extend TODO

This commit is contained in:
Ave Ozkal 2018-12-23 18:07:59 +03:00
parent 0539c195bd
commit b787589ef7
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
3 changed files with 64 additions and 6 deletions

View file

@ -12,13 +12,37 @@ Based on https://gitlab.com/ao/dpybotbase
- [x] .py configs - [x] .py configs
- [x] membercount command - [x] membercount command
- [ ] Verification (and reset) - [ ] Verification (and reset)
- [ ] Logging joins, leaves, role changes, deletes, bans, kicks - [ ] Logging: joins
- [ ] Moderation commands (ban, kick, userinfo, approve-revoke, addhacker-removehacker, lock-softlock-timelock-unlock, mute-mutetime-unmute, playing, botnickname, nickname, clear, probate-unprobate) - [ ] Logging: leaves
- [ ] Warns system (warn, delwarnid-delwarn, listwarns-listwarnsid, clearwarns-clearwarnsid) - [ ] Logging: role changes
- [ ] User notes - [ ] Logging: message edits
- [x] Meme commands and pegaswitch (honestly the easiest part) - [ ] Logging: message deletes
- [ ] Logging: bans
- [ ] Logging: kicks
- [ ] Moderation: ban
- [ ] Moderation: kick
- [x] Moderation: userinfo
- [ ] Moderation: approve-revoke (community)
- [ ] Moderation: addhacker-removehacker
- [ ] Moderation: lock-soft-unlock (channel lockdown)
- [ ] Moderation: timelock (channel lockdown with time)
- [ ] Moderation: mute-unmute
- [ ] Moderation: mutetime
- [ ] Moderation: playing
- [ ] Moderation: botnickname
- [ ] Moderation: nickname
- [ ] Moderation: clear/purge
- [ ] Moderation: probate-unprobate
- [ ] Moderation: watch-unwatch
- [ ] Warns: warn
- [ ] Warns: delwarnid-delwarn
- [ ] Warns: listwarns-listwarnsid
- [ ] Warns: clearwarns-clearwarnsid
- [ ] Modmail
- [ ] Moderation: User notes
- [ ] .serr and .err - [ ] .serr and .err
- [x] Meme commands and pegaswitch (honestly the easiest part)
- [x] source command - [x] source command
- [ ] robocop command - [ ] robocop command
- [ ] eval and sh might need to be removed - [ ] eval and sh might need to be removed at end of development

View file

@ -41,6 +41,7 @@ initial_extensions = ['cogs.common',
'cogs.admin', 'cogs.admin',
'cogs.basic', 'cogs.basic',
'cogs.links', 'cogs.links',
'cogs.mod',
'cogs.meme'] 'cogs.meme']
bot = commands.Bot(command_prefix=get_prefix, bot = commands.Bot(command_prefix=get_prefix,

33
cogs/mod.py Normal file
View file

@ -0,0 +1,33 @@
import discord
from discord.ext import commands
import config
class AdminCog:
def __init__(self, bot):
self.bot = bot
def check_if_staff(ctx):
return any(r.id in config.staff_role_ids for r in ctx.author.roles)
@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")
def setup(bot):
bot.add_cog(AdminCog(bot))