Discordにメッセージが消えるストーリーズを作る
from Red Discord Bot
Discordにメッセージが消えるストーリーズを作る
Cleanup — Red - Discord Bot 3.5.14 documentation
!cleanup messages num
遡って指定した数のメッセージだけ削除する
巨大な数で全部削除はできず、エラーが出る
https://gyazo.com/eee3e95f684c3d3a65d9a0c3fd13bd1b
巨大な数で全削除可能だが、yes/noを訪ねてくる
cleanupでエラーが出る
EOFError: marshal data too short
解決
上のやつもこれだった
スケジュール実行したい
fifo
GitHub - bobloy/Fox-V3: Cogs for Red-DiscordBot V3 by Bobloy
Subcommands:
add Add a new task to this guild's task list
addtrigger Add a new trigger for a task from the current guild.
checktask Returns the next 10 scheduled executions of the task
cleartriggers Removes all triggers from specified task
delete Deletes a task from this guild's task list
details Provide all the details on the specified task name
list Lists all current tasks and their triggers.
pause Provide a task name to pause execution of a task
Subcommands: (continued)
printschedule Print the current schedule of execution.
resume Provide a task name to resume execution of a task.
set Sets a different author or in a different channel for execu...
wakeup Debug command to fix missed executions.
Type !help <command> for more info on a command. You can also type !help <category> for more info on a category.
まずはタスクを追加する
!fifo add cleanup-stories cleanup after <メッセージID>
cleanup-storiesがタスク名
cleanup after <メッセージID>がcleanupコマンド
チャンネルの最初の投稿から全部消すようにした
タイムゾーン指定したほうが無難
!fifo trigger cron cleanup-stories Asia/Tokyo 0 4 * * *