|
|
@ -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,7 +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.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)) |
|
|
|