@@ -141,8 +141,6 @@ async def setup(self, ctx):
141
141
142
142
categ = await ctx .guild .create_category (name = 'modmail' , overwrites = self .overwrites (ctx ))
143
143
await categ .edit (position = 0 )
144
- c = await ctx .guild .create_text_channel (name = 'discussion' , category = categ )
145
- await c .edit (topic = 'DO NOT CHANGE THE CATEGORY NAME OR THE BOT WILL BREAK' )
146
144
await ctx .send ('Successfully set up server.' )
147
145
148
146
@commands .command (name = 'close' )
@@ -203,12 +201,12 @@ def format_info(self, user):
203
201
204
202
return em
205
203
206
- async def send_mail (self , message , channel ):
204
+ async def send_mail (self , message , channel , mod ):
207
205
author = message .author
208
- if isinstance ( channel , discord . TextChannel ) :
209
- fmt = f'» ** { author } :** { message .content } '
206
+ if mod :
207
+ fmt = f'**Mod » { author . name } :** { message .content } '
210
208
else :
211
- fmt = f'» ** { author } (Mod) :** { message .content } '
209
+ fmt = f'**User » { author . name } :** { message .content } '
212
210
embed = None
213
211
if message .embeds :
214
212
embed = message .embeds [0 ]
@@ -221,10 +219,10 @@ async def process_reply(self, message):
221
219
await message .delete ()
222
220
except discord .errors .NotFound :
223
221
pass
224
- await self .send_mail (message , message .channel )
222
+ await self .send_mail (message , message .channel , mod = True )
225
223
user_id = int (message .channel .topic .split (': ' )[1 ])
226
224
user = self .get_user (user_id )
227
- await self .send_mail (message , user )
225
+ await self .send_mail (message , user , mod = True )
228
226
229
227
def format_name (self , author ):
230
228
name = author .name
@@ -245,15 +243,15 @@ async def process_modmail(self, message):
245
243
categ = discord .utils .get (guild .categories , name = 'modmail' )
246
244
247
245
if channel is not None :
248
- await self .send_mail (message , channel )
246
+ await self .send_mail (message , channel , mod = False )
249
247
else :
250
248
channel = await guild .create_text_channel (
251
249
name = self .format_name (author ),
252
250
category = categ
253
251
)
254
252
await channel .edit (topic = topic )
255
253
await channel .send ('@here' , embed = self .format_info (author ))
256
- await self .send_mail (message , channel )
254
+ await self .send_mail (message , channel , mod = False )
257
255
258
256
async def on_message (self , message ):
259
257
if message .author .bot :
0 commit comments