Add Discord like Telegram Integrations

This commit is contained in:
Prograstinator
2022-02-27 00:39:15 +01:00
parent 8964fb9dd7
commit 8e264a4658
6 changed files with 82 additions and 5 deletions

View File

@@ -189,6 +189,7 @@ from colorama import Fore
from TwitchChannelPointsMiner import TwitchChannelPointsMiner
from TwitchChannelPointsMiner.logger import LoggerSettings, ColorPalette
from TwitchChannelPointsMiner.classes.Telegram import Telegram
from TwitchChannelPointsMiner.classes.DiscordWebhook import Discord
from TwitchChannelPointsMiner.classes.Settings import Priority, Events, FollowersOrder
from TwitchChannelPointsMiner.classes.entities.Bet import Strategy, BetSettings, Condition, OutcomeKeys, FilterCondition, DelayMode
from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, StreamerSettings
@@ -219,7 +220,12 @@ twitch_miner = TwitchChannelPointsMiner(
token="123456789:shfuihreuifheuifhiu34578347", # Telegram API token @BotFather
events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, "BET_LOSE"], # Only these events will be sent to the chat
disable_notification=True, # Revoke the notification (sound/vibration)
)
),
discord=Discord(
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
),
),
streamer_settings=StreamerSettings(
make_predictions=True, # If you want to Bet / Make prediction
@@ -434,6 +440,23 @@ 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
2. Click "Edit Channel"
3. Click "Integrations"
4. Click "Webhooks"
5. Click "New Webhook"
6. Name it if you want
7. Click on "Copy Webhook URL"
```python
Discord(
discord_webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J",
events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.BET_LOSE],
)
```
#### Events
- `STREAMER_ONLINE`
- `STREAMER_OFFLINE`