mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-09-17 16:52:47 +00:00
/Umstieg cooldown hinzugefügt
Discord hat diesen nervigen cooldown von 2 mal channel umbennen innerhalb von 10min. In dem cooldown hier ist es 1 mal pro 10 minuten, zur Sicherheit...
This commit is contained in:
+7
-1
@@ -1,4 +1,5 @@
|
||||
import discord
|
||||
import time
|
||||
from config import config
|
||||
from src.utils import random_connection
|
||||
|
||||
@@ -25,6 +26,11 @@ async def rename_vc(bot: discord.Bot) -> bool:
|
||||
train = current['train'].split()[1]
|
||||
train_name = f"{train} nach {current['destination']}"
|
||||
|
||||
print(f"Umstieg: {train_name} von {current['station']} \nüber: {current['via']}")
|
||||
print("-----------------------------------------")
|
||||
current_time = time.strftime('%X')
|
||||
print(f"{current_time}: Umstieg: {train_name} (Typ {train_type}) von {current['station']}")
|
||||
print(f"{current_time}: Wenn hier keine Nachricht mehr kommt bin ich im Cooldown")
|
||||
await channel.edit(name=f"{config['formatting']}{train_name}",)
|
||||
print(f"{current_time}: Name geändert!")
|
||||
print("-----------------------------------------")
|
||||
return True
|
||||
Reference in New Issue
Block a user