Skip to content
Merged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TIMEZONE=UTC # Optional

| Command | Description | Required Permissions |
|---------|-------------|---------------------|
| `/daily [date]` | Display LeetCode.com (LCUS) daily challenge<br>• Optional: YYYY-MM-DD for historical challenges | None |
| `/daily [date]` | Display LeetCode.com (LCUS) daily challenge<br>• Optional: YYYY-MM-DD for historical challenges<br>• Note: Historical data available from April 2020 onwards | None |
| `/daily_cn [date]` | Display LeetCode.cn (LCCN) daily challenge<br>• Optional: YYYY-MM-DD for historical challenges | None |
| `/problem <id> [domain]` | Query any LeetCode problem by ID<br>• `id`: Problem number (1-4000)<br>• `domain`: com or cn (default: com) | None |
| `/recent <username> [limit]` | View recent accepted submissions for a user<br>• `username`: LeetCode username (LCUS only)<br>• `limit`: Number of submissions (1-50, default: 20) | None |
Expand Down
4 changes: 2 additions & 2 deletions cogs/slash_commands_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, bot: commands.Bot):
self.logger = bot.logger

@app_commands.command(name="daily", description="取得 LeetCode 每日挑戰 (LCUS)")
@app_commands.describe(date="查詢指定日期的每日挑戰 (YYYY-MM-DD 格式),不填則為今天")
@app_commands.describe(date="查詢指定日期的每日挑戰 (YYYY-MM-DD 格式),不填則為今天,最早為 2020-04-01")
async def daily_command(self, interaction: discord.Interaction, date: str = None):
"""
Get LeetCode daily challenge (LCUS)
Expand Down Expand Up @@ -64,7 +64,7 @@ async def daily_command(self, interaction: discord.Interaction, date: str = None
await schedule_cog.send_daily_challenge(interaction=interaction, domain="com")

@app_commands.command(name="daily_cn", description="取得 LeetCode 每日挑戰 (LCCN)")
@app_commands.describe(date="查詢指定日期的每日挑戰 (YYYY-MM-DD 格式),不填則為今天")
@app_commands.describe(date="查詢指定日期的每日挑戰 (YYYY-MM-DD 格式),不填則為今天,不填則為今天,最早為 2020-04-01")
async def daily_cn_command(self, interaction: discord.Interaction, date: str = None):
"""Get LeetCode daily challenge (LCCN)"""
schedule_cog = self.bot.get_cog("ScheduleManagerCog")
Expand Down
15 changes: 8 additions & 7 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ discord = "WARNING"
requests = "WARNING"

[leetcode]
# LeetCode API endpoints (usually don't need to change)
[leetcode.endpoints]
us = "https://leetcode.com"
cn = "https://leetcode.cn"

# Request timeout in seconds
timeout = 30

# Retry settings
max_retries = 3
retry_delay = 1
retry_delay = 1
# Monthly fetch delay in seconds between each challenge (to avoid overwhelming the API)
monthly_fetch_delay = 0.5

# LeetCode API endpoints (usually don't need to change)
[leetcode.endpoints]
us = "https://leetcode.com"
cn = "https://leetcode.cn"
Loading