Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord like Telegram Integration #433

Merged
merged 19 commits into from
Mar 5, 2022
Merged

Conversation

prograstinator
Copy link
Contributor

Description

Add Telegram like Discord Webhook Notifications

Fixes a part of #320

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

How Has This Been Tested?

I created a Webhook, copied the example.py, edited the URL and ran it.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md)
  • My changes generate no new warnings
  • Any dependent changes have been updated in requirements.txt

@Tkd-Alex
Copy link
Owner

Wow! Nice! Really appreciate 😃
I'll try asap

@prograstinator prograstinator changed the title Add Discord like Telegram Integration Add Telegram like Discord Integration Feb 27, 2022
@prograstinator
Copy link
Contributor Author

Because I am not an native English speaker I don't know if it is "Discord like Telegram Integration" or "Telegram like Discord Integration".

@Tkd-Alex
Copy link
Owner

Because I am not an native English speaker I don't know if it is "Discord like Telegram Integration" or "Telegram like Discord Integration".

Don't worry, I'm Italian

@Tkd-Alex Tkd-Alex changed the title Add Telegram like Discord Integration Discord like Telegram Integration Feb 27, 2022
@Tkd-Alex
Copy link
Owner

@Tkd-Alex
Copy link
Owner

uhm

  • Please rename the file DiscordWebhook.py to Discord.py
  • I think the attribute discord_webhook_api can be renamed to webhook_api
  • The followings line probably are duplicated
    if hasattr(record, "event"):
    skip_discord = False if hasattr(record, "skip_discord") is False else True
    if self.settings.discord is not None and skip_discord is False:
    self.settings.discord.send(record.msg, record.event)
    if self.settings.colored is True:
    record.msg = (
    f"{self.settings.color_palette.get(record.event)}{record.msg}"
    )

@prograstinator
Copy link
Contributor Author

Now good? @Tkd-Alex

@prograstinator
Copy link
Contributor Author

Now good? @Tkd-Alex

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 2, 2022

🤔 Why we need this commit? cdb5ae0

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 2, 2022

thinking Why we need this commit? cdb5ae0

Due to the last commit I'm unable to use this branch

  File "..../Twitch-Channel-Points-Miner-v2/TwitchChannelPointsMiner/logger.py", line 128, in format
    True if self.settings.telegram.chat_id == 123456789 else False
AttributeError: 'NoneType' object has no attribute 'chat_id'
Call stack:

@prograstinator
Copy link
Contributor Author

thinking Why we need this commit? cdb5ae0

I wanted to check if the config was changed and not just example.py copied to not send unnecessary requests to discord

@prograstinator
Copy link
Contributor Author

Does is work know? @Tkd-Alex

@prograstinator
Copy link
Contributor Author

Is it good so? @Tkd-Alex

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 4, 2022

Is it good so? @Tkd-Alex

I've started the test today

@Tkd-Alex Tkd-Alex merged commit 758f015 into Tkd-Alex:master Mar 5, 2022
@Tkd-Alex Tkd-Alex added the enhancement New feature or request label Mar 5, 2022
lyw1217 referenced this pull request in lyw1217/Twitch-Channel-Points-Miner-v2 Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants