Add Discord like Telegram Integrations

This commit is contained in:
Prograstinator
2022-02-27 00:18:40 +00:00
committed by GitHub
parent 8e264a4658
commit af37fadab9
3 changed files with 6 additions and 4 deletions

View File

@@ -441,8 +441,8 @@ Telegram(
```
#### Discord
If you want to reive log updates on Discord initiate a new Discord class, else leave omit this parameter or set as None
1. Go to the Server you want to recieve updates
If you want to receive log updates on Discord initiate a new Discord class, else leave omit this parameter or set as None
1. Go to the Server you want to receive updates
2. Click "Edit Channel"
3. Click "Integrations"
4. Click "Webhooks"

View File

@@ -8,7 +8,9 @@ from TwitchChannelPointsMiner.classes.Settings import Events
class Telegram(object):
__slots__ = ["chat_id", "telegram_api", "events", "disable_notification"]
def __init__(self, chat_id: int, token: str, events: list, disable_notification: bool = False):
def __init__(
self, chat_id: int, token: str, events: list, disable_notification: bool = False
):
self.chat_id = chat_id
self.telegram_api = f"https://api.telegram.org/bot{token}/sendMessage"

View File

@@ -39,7 +39,7 @@ twitch_miner = TwitchChannelPointsMiner(
),
discord=Discord(
discord_webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J", #Discord Webhook URL
discord_webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J", # Discord Webhook URL
events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.BET_LOSE], # Only these events will be sent to the chat
),
),