Mirror of https://github.com/Jxck-S/plane-notify This is the backend to ElonsJet and other bots
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

9 lines
376 B

def sendDis(message, config, image_name = None):
from discord_webhook import DiscordWebhook
webhook = DiscordWebhook(url=config.get('DISCORD', 'URL'), content=message, username=config.get('DISCORD', 'USERNAME'))
if image_name != None:
with open(image_name, "rb") as f:
webhook.add_file(file=f.read(), filename='map.png')
webhook.execute()