Initial commit
This commit is contained in:
commit
8ca93c1bab
7 changed files with 514 additions and 0 deletions
30
bot.py
Normal file
30
bot.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
from breadtube_bot.manager import DiscordManager
|
||||
from breadtube_bot.objects import TextChannel
|
||||
|
||||
|
||||
def main():
|
||||
bot_token = Path('data/discord_bot_token.txt').read_text(encoding='utf-8').strip()
|
||||
guild_id = 1306964577812086824
|
||||
manager = DiscordManager(bot_token=bot_token, guild_id=guild_id)
|
||||
_categories, text_channel = manager.list_channels()
|
||||
breadtube_channel: TextChannel | None = None
|
||||
for channel in text_channel:
|
||||
if channel.name == 'breadtube-bot':
|
||||
breadtube_channel = channel
|
||||
break
|
||||
|
||||
if breadtube_channel is None:
|
||||
print('Cannot find beadtube-bot channel')
|
||||
sys.exit(1)
|
||||
|
||||
messages = manager.list_text_channel_messages(breadtube_channel)
|
||||
for message in messages:
|
||||
print(message)
|
||||
manager.delete_message(message)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue