Skip to content

Commit

Permalink
Merge pull request #25 from Yuuzi261/hotfix
Browse files Browse the repository at this point in the history
0.4-hotfix
  • Loading branch information
Yuuzi261 authored Jan 25, 2024
2 parents 5a2e42a + 1d49465 commit c384f95
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ In certain operating systems, you may need to use the command `pip3` instead of
**📢This tutorial is suitable for version 0.3.2 or later. (Recommended: 0.3.5 or later)**

<details>
<summary><b>📌click here to upgrade from 0.3.5 to 0.4.0</b></summary>
<summary><b>📌click here to upgrade from 0.3.5 to 0.4</b></summary>

⚠️Before everything starts you must upgrade the version of `tweety-ns` to `1.0.9.2` first and download or pull the new code from this repo.

Expand All @@ -109,7 +109,7 @@ class Upgrade(Cog_Extension):

upgrade_group = app_commands.Group(name='upgrade', description='Upgrade something', default_permissions=ADMINISTRATOR)

@upgrade_group.command(name='version', description='upgrade to Tweetcord 0.4.0')
@upgrade_group.command(name='version', description='upgrade to Tweetcord 0.4')
async def upgrade(self, itn: discord.Interaction):

await itn.response.defer(ephemeral=True)
Expand All @@ -122,9 +122,9 @@ class Upgrade(Cog_Extension):
ALTER TABLE user ADD enabled INTEGER DEFAULT 1;
ALTER TABLE notification ADD customized_msg TEXT DEFAULT NULL;
""")
await itn.followup.send('successfully upgrade to 0.4.0, you can remove this cog and reboot the bot.')
await itn.followup.send('successfully upgrade to 0.4, you can remove this cog and reboot the bot.')
except:
await itn.followup.send('upgrading to 0.4.0 failed, please try again or contact the author.')
await itn.followup.send('upgrading to 0.4 failed, please try again or contact the author.')


async def setup(bot):
Expand Down Expand Up @@ -230,8 +230,8 @@ tweets_check_period: 10 # The check frequency for the posts (it is n
tweets_updater_retry_delay: 300 # Retry Interval when Tweets Updater encounters exceptions (e.g., rate limitations).
tasks_monitor_check_period: 60 # Interval at which to check if each tasks is functioning properly, and if a task has stopped, attempt a restart.
tasks_monitor_log_period: 14400 # Interval at which to output the list of currently running tasks to the execution log.
auto_turn_off_notification: true # (v0.4.0 or later) If all notifications for a user are disabled, decide whether to unfollow the user.
auto_unfollow: true # (v0.4.0 or later) If all notifications for a user is disabled, decide whether to disable notification for the user (twitter side).
auto_turn_off_notification: true # (v0.4 or later) If all notifications for a user are disabled, decide whether to unfollow the user.
auto_unfollow: true # (v0.4 or later) If all notifications for a user is disabled, decide whether to disable notification for the user (twitter side).
```
### 3. Run and invite the bot to your server
Expand Down
12 changes: 6 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pip install -r requirements.txt
**📢本教學適用於0.3.2或更高版本。(建議:0.3.5或更高版本)**

<details>
<summary><b>📌0.3.5升級到0.4.0請點這裡</b></summary>
<summary><b>📌0.3.5升級到0.4請點這裡</b></summary>

⚠️在一切開始之前請先更新 `tweety-ns``1.0.9.2` 版本並且從這個repo下載或拉取新的程式碼。

Expand All @@ -109,7 +109,7 @@ class Upgrade(Cog_Extension):

upgrade_group = app_commands.Group(name='upgrade', description='Upgrade something', default_permissions=ADMINISTRATOR)

@upgrade_group.command(name='version', description='upgrade to Tweetcord 0.4.0')
@upgrade_group.command(name='version', description='upgrade to Tweetcord 0.4')
async def upgrade(self, itn: discord.Interaction):

await itn.response.defer(ephemeral=True)
Expand All @@ -122,9 +122,9 @@ class Upgrade(Cog_Extension):
ALTER TABLE user ADD enabled INTEGER DEFAULT 1;
ALTER TABLE notification ADD customized_msg TEXT DEFAULT NULL;
""")
await itn.followup.send('successfully upgrade to 0.4.0, you can remove this cog and reboot the bot.')
await itn.followup.send('successfully upgrade to 0.4, you can remove this cog and reboot the bot.')
except:
await itn.followup.send('upgrading to 0.4.0 failed, please try again or contact the author.')
await itn.followup.send('upgrading to 0.4 failed, please try again or contact the author.')


async def setup(bot):
Expand Down Expand Up @@ -230,8 +230,8 @@ tweets_check_period: 10 # 檢查推文的頻率(不建議將此值
tweets_updater_retry_delay: 300 # 當Tweets Updater遇到異常(例如速率限制)時的重試間隔。
tasks_monitor_check_period: 60 # 檢查每個任務是否正常運行的間隔,如果某個任務停止了,嘗試重新啟動。
tasks_monitor_log_period: 14400 # 將當前運行中的任務列表輸出到執行日誌的間隔。
auto_turn_off_notification: true # (v0.4.0或更新版本) 如果某個使用者的所有通知都已停用,決定是否取消追蹤該使用者。
auto_unfollow: true # (v0.4.0或更新版本) 如果某個使用者的所有通知都已停用,決定是否停用該使用者的通知(Twitter端)。
auto_turn_off_notification: true # (v0.4或更新版本) 如果某個使用者的所有通知都已停用,決定是否取消追蹤該使用者。
auto_unfollow: true # (v0.4或更新版本) 如果某個使用者的所有通知都已停用,決定是否停用該使用者的通知(Twitter端)。
```
### 3. 運行機器人並邀請至你的伺服器
Expand Down
1 change: 1 addition & 0 deletions cogs/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

class Sync(Cog_Extension):

@app_commands.default_permissions(administrator=True)
@app_commands.command(name='sync')
async def sync(self, itn : discord.Interaction):
"""To sync the notification of new Twitter account with database, use this command.
Expand Down

0 comments on commit c384f95

Please sign in to comment.