Skip to content

Commit

Permalink
fix: Coding conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
winstonsung authored Jul 21, 2024
1 parent 30ea4c0 commit 013a263
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cog/admin_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def on_ready(self) -> None:
# 成員身分組
class RoleView(discord.ui.View):
def __init__(self):
super().__init__(timeout=None) # Timeout of the view must be set to None
super().__init__(timeout = None) # Timeout of the view must be set to None

@discord.ui.button(
label = "領取身分組",
Expand All @@ -38,7 +38,7 @@ async def create_role_button(self, ctx) -> None:
# 禮物按鈕
class Gift(discord.ui.View):
def __init__(self):
super().__init__(timeout=None) # Timeout of the view must be set to None
super().__init__(timeout = None) # Timeout of the view must be set to None
self.type = None # 存放這個按鈕是送電電點還是抽獎券,預設 None ,在建立按鈕時會設定 see view.type = gift_type
self.count = 0 # 存放這個按鈕是送多少電電點/抽獎券

Expand Down Expand Up @@ -127,13 +127,13 @@ async def record_db(btn_id: int, gift_type: str, count: int, recipient: str) ->
# DM 一個 Embed 和領取按鈕
for target_user in target_users:
try:
await target_user.send(embed=embed)
await target_user.send(embed = embed)
msg = await target_user.send(view=view)
await record_db(msg.id, gift_type, count, target_user.name)
except discord.Forbidden:
await ctx.respond(f"無法向使用者 {target_user.name} 傳送訊息,可能是因為他們關閉了 DM。", ephemeral=True)
await ctx.respond(f"無法向使用者 {target_user.name} 傳送訊息,可能是因為他們關閉了 DM。", ephemeral = True)
else:
await ctx.respond("你沒有權限使用這個指令!", ephemeral=True)
await ctx.respond("你沒有權限使用這個指令!", ephemeral = True)
return

def setup(bot):
Expand Down

0 comments on commit 013a263

Please sign in to comment.