Skip to content

Commit

Permalink
Merge pull request #164 from crimsobot/no-more-discriminators
Browse files Browse the repository at this point in the history
Obliterating every discriminator I could find
  • Loading branch information
h-anjru authored Jul 24, 2024
2 parents 0f2f3ae + 861f44f commit 6491290
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions crimsobot/cogs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def ban(self, ctx: commands.Context, discord_user: discord.User) -> None:

embed = c.crimbed(
title=None,
descr='**{}** has been banned from using crimsoBOT.'.format(discord_user),
descr=f'**{discord_user.name}** has been banned from using crimsoBOT.',
color_name='orange'
)

Expand All @@ -72,7 +72,7 @@ async def unban(self, ctx: commands.Context, discord_user: discord.User) -> None

embed = c.crimbed(
title=None,
descr='**{}** has been unbanned from using crimsoBOT.'.format(discord_user),
descr=f'**{discord_user.name}** has been unbanned from using crimsoBOT.',
color_name='yellow'
)

Expand All @@ -87,7 +87,7 @@ async def banlist(self, ctx: commands.Context) -> None:
banned_users = []
for user_id in self.bot.banned_user_ids:
discord_user = await self.bot.fetch_user(user_id)
banned_users.append('· {u.name}#{u.discriminator}'.format(u=discord_user))
banned_users.append('· {u.name} ({u.id})'.format(u=discord_user))

if not banned_users:
banned_users.append('No users are banned... yet')
Expand Down
4 changes: 2 additions & 2 deletions crimsobot/cogs/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_image_and_embed(self, ctx: commands.Context, image: Optional[str],
title=title,
descr=None,
attachment=filename,
footer='Requested by {}'.format(ctx.author),
footer='Requested by {}'.format(ctx.author.name),
)

await ctx.send(file=f, embed=embed)
Expand Down Expand Up @@ -162,7 +162,7 @@ async def boop(self, ctx: commands.Context, mention: discord.Member) -> None:
f = discord.File(fp, filename)

embed = c.crimbed(
title='{} booped {}!'.format(ctx.author, mention),
title=f'{ctx.author.name} booped {mention.name}!',
descr=None,
attachment=filename,
)
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/cogs/reactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def fact_inspect(self, ctx: commands.Context, fact_id: int) -> None:
field_list = [
('Subject', fact_object.subject),
('Body', fact_object.body[:500] + '...' if len(fact_object.body) > 500 else fact_object.body),
('Added by', f'{fact_adder} ({fact_adder.id})'),
('Added by', f'{fact_adder.name} ({fact_adder.id})'),
('Server', f'{guild.name} ({guild.id})'),
(
'Added on',
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/cringo_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def get_embed(self, ctx: commands.Context) -> Embed:
discord_user = await ctx.bot.fetch_user(leader.user_id)
place = self._offset + place + 1
self._embed.add_field(
name='{}. **{}**'.format(place, str(discord_user)),
name='{}. **{}**'.format(place, str(discord_user.name)),
value=leader.value,
inline=False
)
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/fact_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def sub_usernames(self, ctx: commands.Context, string: str) -> str:
matches = [int(item) for item in re.findall(r'<@(\d+)>', string)]
for user_id in matches: # all of these will be match group 1 matches cast to int, so just plain ol' IDs
user = ctx.bot.get_user(user_id) or await ctx.bot.fetch_user(user_id)
string = string.replace(f'<@{user_id}>', f'@{user}', 1)
string = string.replace(f'<@{user_id}>', f'@{user.name}', 1)

return string

Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async def guess_stat_embed(user: DiscordUser) -> Embed:
)
else:
embed = c.crimbed(
title='GUESSMOJI! stats for {}'.format(user),
title='GUESSMOJI! stats for {}'.format(user.name),
descr=None,
thumb_name='crimsoCOIN',
footer='Stat tracking as of {d.year}-{d.month:02d}-{d.day:02d}'.format(d=s.created_at),
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/guess_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def get_embed(self, ctx: commands.Context) -> Embed:
discord_user = await ctx.bot.fetch_user(leader.user_id)
place = self._offset + place + 1
self._embed.add_field(
name='{}. **{}**'.format(place, str(discord_user)),
name='{}. **{}**'.format(place, str(discord_user.name)),
value=leader.value,
inline=False
)
Expand Down
4 changes: 2 additions & 2 deletions crimsobot/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ async def process_image(ctx: Context, image: Optional[str], effect: str, arg: Op
embed = c.crimbed(
title='PLS TO HOLD...',
descr='\n'.join([
f'Processing GIF for **{ctx.author}**...',
f'Processing GIF for **{ctx.author.name}**...',
f'{img.width} \u2A09 {img.height} pixels · {img.n_frames} frames',
]),
footer=f'GIF cost: \u20A2{cost:.2f} · Your balance: \u20A2{bal:.2f} ➡️ \u20A2{new_bal:.2f}',
Expand Down Expand Up @@ -720,7 +720,7 @@ async def process_image(ctx: Context, image: Optional[str], effect: str, arg: Op

if is_gif:
embed.title = 'COMPLETE!'
embed.description = f'Processed GIF for **{ctx.author}**!'
embed.description = f'Processed GIF for **{ctx.author.name}**!'
embed.color = 0x5AC037
await msg.edit(embed=embed)

Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def get_embed(self, ctx: commands.Context) -> Embed:
discord_user = await ctx.bot.fetch_user(leader.user_id)
place = self._offset + place + 1
self._embed.add_field(
name='{}. **{}**'.format(place, str(discord_user)),
name=f'{place}. **{discord_user.name}**',
value=leader.value,
inline=False
)
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/tarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ async def tarot_embed(
f = discord.File(fp, filename)

embed = c.crimbed(
title="{}'s reading".format(ctx.author),
title=f"{ctx.author.name}'s reading",
descr=None,
attachment=filename,
footer=f'{help_str}\nType ">tarot card" for more on a specific card.',
Expand Down
2 changes: 1 addition & 1 deletion crimsobot/utils/wordle.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ async def wordle_stat_embed(user: DiscordUser) -> Embed:
histogram_string_list = '\n'.join(histogram_strings)

embed = c.crimbed(
title=f'WORDLE stats for {user}',
title=f'WORDLE stats for {user.name}',
descr=None,
thumb_name='wordle',
footer='Thanks for playing >wordle!',
Expand Down

0 comments on commit 6491290

Please sign in to comment.