@@ -28,6 +28,13 @@ async def setup(bot: bot.TechSupportBot) -> None:
2828 description = "The ID of the channel to send auto-protect alerts to" ,
2929 default = None ,
3030 )
31+ config .add (
32+ key = "anonymous" ,
33+ datatype = "bool" ,
34+ title = "If reports are anonymous" ,
35+ description = "Whether reports are anonymous" ,
36+ default = False ,
37+ )
3138 await bot .add_cog (Report (bot = bot , extension_name = "report" ))
3239 bot .add_extension_config ("report" , config )
3340
@@ -38,7 +45,7 @@ class Report(cogs.BaseCog):
3845 @app_commands .command (
3946 name = "report" ,
4047 description = "Reports something to the moderators" ,
41- extras = {"module" : "report" },
48+ extras = {"module" : "report" , "suppress_logs" : True },
4249 )
4350 async def report_command (
4451 self : Self , interaction : discord .Interaction , report_str : str
@@ -59,17 +66,31 @@ async def report_command(
5966
6067 embed = discord .Embed (title = "New Report" , description = report_str )
6168 embed .color = discord .Color .red ()
62- embed .set_author (
63- name = interaction .user .name ,
64- icon_url = interaction .user .avatar .url or interaction .user .default_avatar .url ,
65- )
69+
70+ config = self .bot .guild_configs [str (interaction .guild .id )]
71+
72+ is_anonymous = config .extensions .report .anonymous .value
73+
74+ if is_anonymous :
75+ embed .set_author (name = "Anonymous" )
76+ else :
77+ embed .set_author (
78+ name = interaction .user .name ,
79+ icon_url = interaction .user .avatar .url
80+ or interaction .user .default_avatar .url ,
81+ )
82+ embed .add_field (
83+ name = "User info" ,
84+ value = (
85+ f"**Name:** { interaction .user .name } ({ interaction .user .mention } )\n "
86+ f"**Joined:** <t:{ int (interaction .user .joined_at .timestamp ())} :R>\n "
87+ f"**Created:** <t:{ int (interaction .user .created_at .timestamp ())} :R>\n "
88+ ),
89+ )
6690
6791 embed .add_field (
68- name = "User info " ,
92+ name = "** ** " ,
6993 value = (
70- f"**Name:** { interaction .user .name } ({ interaction .user .mention } )\n "
71- f"**Joined:** <t:{ int (interaction .user .joined_at .timestamp ())} :R>\n "
72- f"**Created:** <t:{ int (interaction .user .created_at .timestamp ())} :R>\n "
7394 f"**Sent from:** { interaction .channel .mention } [Jump to context]"
7495 f"(https://discord.com/channels/{ interaction .guild .id } /{ interaction .channel .id } /"
7596 f"{ discord .utils .time_snowflake (datetime .datetime .utcnow ())} )"
@@ -101,11 +122,10 @@ async def report_command(
101122 ),
102123 )
103124
104- embed .set_footer (text = f"Author ID: { interaction .user .id } " )
125+ if not is_anonymous :
126+ embed .set_footer (text = f"Author ID: { interaction .user .id } " )
105127 embed .timestamp = datetime .datetime .utcnow ()
106128
107- config = self .bot .guild_configs [str (interaction .guild .id )]
108-
109129 try :
110130 alert_channel = interaction .guild .get_channel (
111131 int (config .extensions .report .alert_channel .value )
0 commit comments