Skip to content

Commit 55670c3

Browse files
committed
Resolved a TODO
1 parent 44adfaa commit 55670c3

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Breaking changes.
248248
# v2.0.10
249249

250250
### Security
251-
- Fix a bug where blocked users were still able to message modmail.
251+
- Fix a bug where blocked users were still able to message Modmail.
252252

253253
# v2.0.9
254254

@@ -273,7 +273,7 @@ Improvements to commands and new config options available.
273273
### Changed
274274
- You now have the ability to supply a reason when blocking a user.
275275
- Blocked users are now stored in the database instead of in the channel topic.
276-
- This means you can delete the top channel in the modmail category now. (Migrate first though.)
276+
- This means you can delete the top channel in the Modmail category now. (Migrate first though.)
277277

278278
# v2.0.7
279279

@@ -303,7 +303,7 @@ New command and improvements in bot update message interfaces.
303303
# v2.0.4
304304

305305
### Fixed
306-
- Fixed a one-off bug where the channel topic disappears, but modmail operations should still continue.
306+
- Fixed a one-off bug where the channel topic disappears, but Modmail operations should still continue.
307307
- Fixed `linked_message_id` issues.
308308

309309
# v2.0.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22
<img src='https://i.imgur.com/o558Qnq.png' align='center'>
33
<br>
4-
<strong><i>A simple and functional modmail bot for Discord.</i></strong>
4+
<strong><i>A simple and functional Modmail bot for Discord.</i></strong>
55
<br>
66
<br>
77

bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ async def process_modmail(self, message):
357357
blocked_em = discord.Embed(
358358
title='Message not sent!',
359359
color=discord.Color.red(),
360-
description='You have been blocked from using modmail.'
360+
description='You have been blocked from using Modmail.'
361361
)
362362

363363
if str(message.author.id) in self.blocked_users:
@@ -518,7 +518,7 @@ async def validate_api_token(self):
518518
'with a token from https://dashboard.modmail.tk')
519519
print('If you want to self-host logs, '
520520
'input a MONGO_URI config variable.')
521-
print('A modmail api token is not needed '
521+
print('A Modmail api token is not needed '
522522
'if you are self-hosting logs.')
523523
return await self.logout()
524524
else:
@@ -599,7 +599,7 @@ async def autoupdate_loop(self):
599599
embed.set_author(name=user['username'] + ' - Updating Bot',
600600
icon_url=user['avatar_url'],
601601
url=user['url'])
602-
embed.set_footer(text=f"Updating modmail v{self.version} "
602+
embed.set_footer(text=f"Updating Modmail v{self.version} "
603603
f"-> v{metadata['latest_version']}")
604604

605605
changelog = await ChangeLog.from_repo(self)

cogs/modmail.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ async def move(self, ctx, *, category: discord.CategoryChannel):
136136
"""Moves a thread to a specified category."""
137137
thread = await self.bot.threads.find(channel=ctx.channel)
138138
if not thread:
139-
return await ctx.send('This is not a modmail thread.')
139+
embed = discord.Embed(
140+
title='Error',
141+
description='This is not a Modmail thread.',
142+
color=discord.Color.red()
143+
)
144+
return await ctx.send(embed=embed)
140145

141146
await thread.channel.edit(category=category, sync_permissions=True)
142147
await ctx.message.add_reaction('✅')

cogs/utility.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async def update(self, ctx):
246246
embed.set_author(name=user['username'],
247247
icon_url=user['avatar_url'],
248248
url=user['url'])
249-
embed.set_footer(text=f'Updating modmail v{self.bot.version} '
249+
embed.set_footer(text=f'Updating Modmail v{self.bot.version} '
250250
f"-> v{metadata['latest_version']}")
251251

252252
if commit_data:
@@ -258,7 +258,6 @@ async def update(self, ctx):
258258
embed.description = latest.description
259259
for name, value in latest.fields.items():
260260
embed.add_field(name=name, value=value)
261-
# TODO: message unused?
262261
# message = commit_data['commit']['message']
263262
html_url = commit_data["html_url"]
264263
short_sha = commit_data['sha'][:6]
@@ -306,7 +305,7 @@ async def activity(self, ctx, activity_type: str, *, message: str = ''):
306305

307306
if activity_type == ActivityType.streaming:
308307
url = self.bot.config.get('twitch_url',
309-
'https://www.twitch.tv/discord-modmail/')
308+
'https://www.twitch.tv/discord-Modmail/')
310309
else:
311310
url = None
312311
activity = Activity(type=activity_type, name=message, url=url)
@@ -537,14 +536,23 @@ async def add_(self, ctx, name: str.lower, *, value):
537536
if 'aliases' not in self.bot.config.cache:
538537
self.bot.config['aliases'] = {}
539538

540-
# TODO: Make embed
541539
if self.bot.get_command(name) or self.bot.config.aliases.get(name):
542-
return await ctx.send('A command or alias already exists '
543-
f'with the same name: `{name}`')
540+
embed = Embed(
541+
title='Error',
542+
color=Color.red(),
543+
description='A command or alias already exists '
544+
f'with the same name: `{name}`.'
545+
)
546+
return await ctx.send(embed=embed)
544547

545548
if not self.bot.get_command(value.split()[0]):
546-
return await ctx.send('The command you are attempting to point '
547-
f'to does not exist: `{value.split()[0]}`')
549+
embed = Embed(
550+
title='Error',
551+
color=Color.red(),
552+
description='The command you are attempting to point '
553+
f'to does not exist: `{value.split()[0]}`.'
554+
)
555+
return await ctx.send(embed=embed)
548556

549557
self.bot.config.aliases[name] = value
550558
await self.bot.config.update()

0 commit comments

Comments
 (0)