Skip to content

Commit fa69da1

Browse files
committed
Made some formatting changes
1 parent b7909f2 commit fa69da1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

bot.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ async def setup(self, ctx):
141141

142142
categ = await ctx.guild.create_category(name='modmail', overwrites=self.overwrites(ctx))
143143
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')
146144
await ctx.send('Successfully set up server.')
147145

148146
@commands.command(name='close')
@@ -203,12 +201,12 @@ def format_info(self, user):
203201

204202
return em
205203

206-
async def send_mail(self, message, channel):
204+
async def send_mail(self, message, channel, mod):
207205
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}'
210208
else:
211-
fmt = f'» **{author} (Mod):** {message.content}'
209+
fmt = f'**User » {author.name}:** {message.content}'
212210
embed = None
213211
if message.embeds:
214212
embed = message.embeds[0]
@@ -221,10 +219,10 @@ async def process_reply(self, message):
221219
await message.delete()
222220
except discord.errors.NotFound:
223221
pass
224-
await self.send_mail(message, message.channel)
222+
await self.send_mail(message, message.channel, mod=True)
225223
user_id = int(message.channel.topic.split(': ')[1])
226224
user = self.get_user(user_id)
227-
await self.send_mail(message, user)
225+
await self.send_mail(message, user, mod=True)
228226

229227
def format_name(self, author):
230228
name = author.name
@@ -245,15 +243,15 @@ async def process_modmail(self, message):
245243
categ = discord.utils.get(guild.categories, name='modmail')
246244

247245
if channel is not None:
248-
await self.send_mail(message, channel)
246+
await self.send_mail(message, channel, mod=False)
249247
else:
250248
channel = await guild.create_text_channel(
251249
name=self.format_name(author),
252250
category=categ
253251
)
254252
await channel.edit(topic=topic)
255253
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)
257255

258256
async def on_message(self, message):
259257
if message.author.bot:

0 commit comments

Comments
 (0)