Clear the list at the beginning of the reconnection

feature/embed-uploads
Tristan Gosselin-Hane 7 years ago
parent a7ce5bdb40
commit 1b41821bde
No known key found for this signature in database
GPG Key ID: D2282BE1CF7B78DA
  1. 4
      webhook-bridge.py

@ -386,6 +386,8 @@ def main():
@discord_bot.event @discord_bot.event
async def on_ready(): async def on_ready():
logging.info("Discord bot logged in as {} ({})".format(discord_bot.user.name, discord_bot.user.id)) logging.info("Discord bot logged in as {} ({})".format(discord_bot.user.name, discord_bot.user.id))
global WEBHOOKS
WEBHOOKS = []
session = database_session.get_session() session = database_session.get_session()
channels = session.query(DiscordChannel).all() channels = session.query(DiscordChannel).all()
session.close() session.close()
@ -396,8 +398,6 @@ def main():
found = False found = False
for webhook in channel_webhooks: for webhook in channel_webhooks:
if webhook.name == "_minecraft": if webhook.name == "_minecraft":
global WEBHOOKS
WEBHOOKS = []
WEBHOOKS.append(webhook.url) WEBHOOKS.append(webhook.url)
found = True found = True
logging.debug("Found webhook {} in channel {}".format(webhook.name, discord_channel.name)) logging.debug("Found webhook {} in channel {}".format(webhook.name, discord_channel.name))

Loading…
Cancel
Save