mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-09-17 16:52:47 +00:00
Compare commits
2
Commits
8dfa092229
...
c24749383b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c24749383b | ||
|
|
5609a3c425 |
@@ -158,7 +158,7 @@ The bot can join the voice chat, play an audio file, and disconnect from the voi
|
||||
Place the audio file of your desired station in [src/data/announcements](src/data/announcements/) with the EXACT name of the station. The bot will automatically check if an audio file with the stations name exists, and if it does, play it.
|
||||
#### http
|
||||
|
||||
- `"user_agent"`: The user agent of the bot for the API. If you don't know what that is, then you shouldn't have to change that.
|
||||
- `"user_agent"`: The user agent of the bot for the API. If you don't know what that is, then you shouldn't have to change that. Modify the contact URL (in my case, the github repo) if you change a lot of the code, so that transitous can contact you in case of any issues
|
||||
|
||||
## Running
|
||||
After you've set everything up, you're ready to start the bot!
|
||||
|
||||
+1
-1
@@ -28,6 +28,6 @@
|
||||
"voice_announcements": false
|
||||
},
|
||||
"http": {
|
||||
"user_agent": "Gleiswechsel-Discord-Bot"
|
||||
"user_agent": "Gleiswechsel-Discord-Bot/1.0 (https://github.com/kaaninchen/Gleiswechsel)"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ channel:
|
||||
short_name: "{train_name} nach {goes_to}"
|
||||
embeds:
|
||||
footer:
|
||||
notice: "Daten bereitgestellt von https://transitous.org • Maps (C) CARTO (C) OpenStreetMap.org contributors"
|
||||
notice: "https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors"
|
||||
info:
|
||||
description: "Abfahrt von {station} um {departure}. Ankunft um {arrival}"
|
||||
via: "Über"
|
||||
|
||||
@@ -5,7 +5,7 @@ channel:
|
||||
short_name: "{train_name} to {goes_to}"
|
||||
embeds:
|
||||
footer:
|
||||
notice: "Data provided by https://transitous.org • Maps (C) CARTO (C) OpenStreetMap.org contributors"
|
||||
notice: "Data provided by https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors"
|
||||
info:
|
||||
description: "Departure from {station} at {departure}. Arrival by {arrival}"
|
||||
via: "via"
|
||||
|
||||
@@ -108,6 +108,10 @@ OPERATORS = {
|
||||
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Stadtwerke_T%C3%BCbingen_logo.svg/330px-Stadtwerke_T%C3%BCbingen_logo.svg.png",
|
||||
"color": 0x439669
|
||||
},
|
||||
"Südwestdeutsche Verkehrs-AG": {
|
||||
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/30/SWEG_Logo.svg/330px-SWEG_Logo.svg.png?utm_source=de.wikipedia.org&utm_campaign=index&utm_content=thumbnail",
|
||||
"color": 0x1A509A
|
||||
},
|
||||
"Tallink Grupp AS": {
|
||||
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Tallink_logo.svg/330px-Tallink_logo.svg.png",
|
||||
"color": 0x225197
|
||||
|
||||
@@ -145,7 +145,11 @@ async def _update_next_loop(voice_channel: discord.VoiceChannel):
|
||||
next_stop_str = next_stop["name"]
|
||||
|
||||
status_text = f"{lang.embeds.info.next_stop()}: {next_stop_str}"
|
||||
|
||||
try:
|
||||
await voice_channel.set_status(status_text, reason="Next stop status")
|
||||
except discord.HTTPException as e:
|
||||
logger(F"Failed to set the channel status (network error?): {e}", "error")
|
||||
|
||||
if config.announcements.voice_announcements:
|
||||
if len(voice_channel.members) > 0:
|
||||
|
||||
Reference in New Issue
Block a user