botnickname/nickname: added

This commit is contained in:
Ave Ozkal 2018-12-23 20:56:27 +03:00
parent b2a907babf
commit a5a5a2f876
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 30 additions and 3 deletions

View file

@ -32,8 +32,8 @@ Based on https://gitlab.com/ao/dpybotbase
- [ ] Moderation: mute-unmute
- [ ] Moderation: mutetime
- [x] Moderation: playing
- [ ] Moderation: botnickname
- [ ] Moderation: nickname
- [x] Moderation: botnickname
- [x] Moderation: nickname
- [ ] Moderation: clear/purge
- [ ] Moderation: probate-unprobate
- [ ] Moderation: watch-unwatch (using log module from akbbot)
@ -42,6 +42,7 @@ Based on https://gitlab.com/ao/dpybotbase
- [ ] Warns: listwarns-listwarnsid
- [ ] Warns: clearwarns-clearwarnsid
- [ ] Modmail
- [ ] Submiterr
- [ ] Moderation: User notes
- [x] .serr and .err
- [x] Meme commands and pegaswitch (honestly the easiest part)

View file

@ -142,7 +142,7 @@ class ModCog:
@commands.check(check_if_staff)
@commands.command(aliases=["setplaying", "setgame"])
async def playing(self, ctx, *, game: str = ""):
"""Sets the currently played game name, staff only.
"""Sets the bot's currently played game name, staff only.
Just send .playing to wipe the playing state."""
if game:
@ -150,6 +150,32 @@ class ModCog:
else:
await self.bot.change_presence(activity=None)
@commands.guild_only()
@commands.check(check_if_staff)
@commands.command(aliases=["setbotnick", "botnick", "robotnick"])
async def botnickname(self, ctx, *, nick: str = ""):
"""Sets the bot's nickname, staff only.
Just send .botnickname to wipe the nickname."""
if nick:
await ctx.guild.me.edit(nick=nick, reason=str(ctx.author))
else:
await ctx.guild.me.edit(nick=None, reason=str(ctx.author))
@commands.guild_only()
@commands.check(check_if_staff)
@commands.command(aliases=["setnick", "nick"])
async def nickname(self, ctx, target: discord.Member, *, nick: str = ""):
"""Sets a user's nickname, staff only.
Just send .nickname <user> to wipe the nickname."""
if nick:
await target.edit(nick=nick, reason=str(ctx.author))
else:
await target.edit(nick=None, reason=str(ctx.author))
def setup(bot):
bot.add_cog(ModCog(bot))