Skip to content

Commit

Permalink
lots of different error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-zaidali committed Jun 20, 2023
1 parent 198c7b3 commit 6df347f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
10 changes: 5 additions & 5 deletions hitormiss/main.py
Expand Up @@ -276,7 +276,7 @@ async def hom(self, ctx):
await ctx.send_help(ctx.command)

@hom.command(name="shop", aliases=["items"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def hom_shop(self, ctx: commands.Context):
"""
See items available to buy for Hit Or Miss.
Expand Down Expand Up @@ -312,7 +312,7 @@ async def hom_shop(self, ctx: commands.Context):
await view.start()

@hom.command(name="inventory", aliases=["inv"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def hom_inv(self, ctx: commands.Context):
"""
See all the items that you currently own in Hit Or Miss."""
Expand Down Expand Up @@ -387,7 +387,7 @@ async def hom_buy(
)

@hom.command(name="stats", aliases=["profile"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def hom_stats(
self,
ctx: commands.Context,
Expand All @@ -405,7 +405,7 @@ async def hom_stats(
await ctx.send(embed=embed)

@hom.command(name="createitem", aliases=["make", "create", "newitem", "ci"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@commands.is_owner()
async def hom_create(self, ctx: commands.Context):
"""
Expand Down Expand Up @@ -506,7 +506,7 @@ async def hom_delete(
cooldown_after_parsing=True,
usage="[type=kills] [global_or_local=False]",
)
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def hom_lb(
self,
ctx: commands.Context,
Expand Down
14 changes: 7 additions & 7 deletions joinping/main.py
Expand Up @@ -99,7 +99,7 @@ async def jpset(self, ctx):
return await ctx.send_help()

@jpset.command(name="test", aliases=["testping"], hidden=True)
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpset_test(self, ctx):
"""
Test whether the pings and message you set up work correctly.
Expand All @@ -112,7 +112,7 @@ async def jpset_test(self, ctx):
await self.on_member_join(ctx.author)

@jpset.command(name="deleteafter", aliases=["da"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpset_da(self, ctx, seconds: int):
"""Set the time in seconds after which the ping message will be deleted."""
if seconds < 0:
Expand All @@ -122,7 +122,7 @@ async def jpset_da(self, ctx, seconds: int):
await ctx.send(f"The ping message will be deleted after {seconds} seconds.")

@jpset.command(name="message", aliases=["m"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpset_msg(self, ctx, *, message: str):
"""Set the message that will be sent when a user joins.
Expand All @@ -142,14 +142,14 @@ async def jpset_msg(self, ctx, *, message: str):
await ctx.send(f"The ping message has been set to:\n{message}")

@jpset.group(name="channel", aliases=["c", "channels"], invoke_without_command=True)
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpset_channels(self, ctx):
"""
Set the channels where the pings will be sent on member join."""
return await ctx.send_help()

@jpset_channels.command(name="remove", aliases=["r"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpsetchan_remove(self, ctx, *channels: discord.TextChannel):
"""
Add the channels to the list of channels where the pings will be sent on member join."""
Expand All @@ -175,7 +175,7 @@ async def jpsetchan_remove(self, ctx, *channels: discord.TextChannel):
)

@jpset_channels.command(name="add", aliases=["a"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpsetchan_add(self, ctx, *channels: discord.TextChannel):
"""
Remove the channels from the list of channels where the pings will be sent on member join.
Expand All @@ -196,7 +196,7 @@ async def jpsetchan_add(self, ctx, *channels: discord.TextChannel):
)

@jpset.command(name="show", aliases=["showsettings", "settings", "setting"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
async def jpset_show(self, ctx):
"""
Show the current joinping settings.
Expand Down
2 changes: 2 additions & 0 deletions keywordpoints/main.py
Expand Up @@ -244,6 +244,7 @@ async def kwp_remove(self, ctx: commands.Context, keyword: str):
await ctx.send(cf.success(f"Keyword `{keyword}` removed."))

@kwp.command(name="list")
@commands.bot_has_permissions(embed_links=True)
@commands.mod_or_permissions(manage_guild=True)
async def kwp_list(self, ctx: commands.Context):
"""List all keywords in this server."""
Expand Down Expand Up @@ -282,6 +283,7 @@ def handle_keyword(keyword: str):
await menu(ctx, embeds, DEFAULT_CONTROLS)

@kwp.command(name="leaderboard", aliases=["lb"])
@commands.bot_has_permissions(embed_links=True)
async def kwp_lb(self, ctx: commands.Context):
"""
See a leaderboard of points of each member in the server."""
Expand Down
4 changes: 2 additions & 2 deletions notes/notes.py
Expand Up @@ -213,7 +213,7 @@ async def setnote(
await ctx.send(f"Note added to **{member}**\nNote:- {note}")

@commands.command(name="allnotes", aliases=["guildnotes"])
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@commands.mod_or_permissions(manage_messages=True)
async def allnotes(self, ctx: commands.Context):
"""
Expand Down Expand Up @@ -252,7 +252,7 @@ async def allnotes(self, ctx: commands.Context):
await view.start()

@commands.command()
@commands.has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@commands.mod_or_permissions(manage_messages=True)
async def notes(self, ctx: commands.Context, member: discord.User = commands.Author):
"""
Expand Down
2 changes: 1 addition & 1 deletion timer/models.py
Expand Up @@ -163,7 +163,7 @@ async def start(self):
color=await self.get_embed_color(),
)
.set_thumbnail(url=getattr(self.guild.icon, "url", ""))
.set_footer(text=f"Hosted by: {self.host}", icon_url=self.host.avatar_url)
.set_footer(text=f"Hosted by: {self.host}", icon_url=self.hostdisplay_avatar.url)
)

msg: discord.Message = await self.channel.send(embed=embed)
Expand Down
5 changes: 4 additions & 1 deletion timer/timers.py
Expand Up @@ -108,6 +108,7 @@ async def timer(self, ctx: commands.Context):
Manage Timers."""

@timer.command(name="start")
@commands.bot_has_permissions(embed_links=True)
async def timer_start(
self, ctx: commands.Context, time: TimeConverter, *, name: str = "New Timer!"
):
Expand Down Expand Up @@ -148,13 +149,14 @@ async def timer_end(self, ctx: commands.Context, timer_id: int):
timer = await self.get_timer(ctx.guild.id, timer_id)

if timer is None:
await ctx.tick(message="Timer not found.")
await ctx.send("Timer not found.")
return

await timer.end()
await ctx.tick(message="Timer ended!")

@timer.command(name="list")
@commands.bot_has_permissions(embed_links=True)
async def timer_list(self, ctx: commands.Context):
"""
Get a list of all the active timers in this server."""
Expand All @@ -175,6 +177,7 @@ async def timer_list(self, ctx: commands.Context):
await ctx.send(embed=embed)

@commands.group(name="timerset", aliases=["tset", "timersettings"])
@commands.bot_has_permissions(embed_links=True)
@commands.mod_or_permissions(manage_messages=True)
async def tset(self, ctx: commands.Context):
"""
Expand Down
2 changes: 1 addition & 1 deletion timer/utils.py
Expand Up @@ -56,7 +56,7 @@ async def convert(self, ctx: commands.Context, argument: str):
emoji.EMOJI_DATA[argument]

except KeyError:
return await super().convert(ctx, argument)
return str(await super().convert(ctx, argument))

else:
return argument

0 comments on commit 6df347f

Please sign in to comment.