2018-12-27 10:56:24 +00:00
|
|
|
import discord
|
|
|
|
from discord.ext import commands
|
2019-02-28 22:10:30 +00:00
|
|
|
from discord.ext.commands import Cog
|
2023-03-09 22:01:10 +00:00
|
|
|
|
|
|
|
from robocop_ng.helpers.checks import check_if_staff
|
|
|
|
from robocop_ng.helpers.userlogs import userlog
|
2018-12-27 10:56:24 +00:00
|
|
|
|
|
|
|
|
2019-02-28 22:10:30 +00:00
|
|
|
class ModNote(Cog):
|
2018-12-27 10:56:24 +00:00
|
|
|
def __init__(self, bot):
|
|
|
|
self.bot = bot
|
|
|
|
|
|
|
|
@commands.guild_only()
|
|
|
|
@commands.check(check_if_staff)
|
|
|
|
@commands.command(aliases=["addnote"])
|
|
|
|
async def note(self, ctx, target: discord.Member, *, note: str = ""):
|
|
|
|
"""Adds a note to a user, staff only."""
|
2023-04-05 10:10:18 +00:00
|
|
|
userlog(self.bot, target.id, ctx.author, note, "notes", target.name)
|
2018-12-27 21:36:18 +00:00
|
|
|
await ctx.send(f"{ctx.author.mention}: noted!")
|
2018-12-27 10:56:24 +00:00
|
|
|
|
|
|
|
@commands.guild_only()
|
|
|
|
@commands.check(check_if_staff)
|
|
|
|
@commands.command(aliases=["addnoteid"])
|
|
|
|
async def noteid(self, ctx, target: int, *, note: str = ""):
|
|
|
|
"""Adds a note to a user by userid, staff only."""
|
2023-04-05 10:10:18 +00:00
|
|
|
userlog(self.bot, target, ctx.author, note, "notes")
|
2020-02-03 17:18:30 +00:00
|
|
|
await ctx.send(f"{ctx.author.mention}: noted!")
|
2018-12-27 10:56:24 +00:00
|
|
|
|
|
|
|
|
2022-05-24 18:35:42 +00:00
|
|
|
async def setup(bot):
|
|
|
|
await bot.add_cog(ModNote(bot))
|