forked from Cog-Creators/Red-DiscordBot
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VxTwit] Add
ddinstagram.com
replacements (#656)
* [VxTwit] Add `ddinstagram.com` replacements This commit adds event listeners to replace instagram.com links with ddinstagram.com. It is using the same toggle as VxTwit. Since instagram.com embeds don't have videos or photos, we will need to replace all embeds. As such, the `valid` method was modified to not check for videos in embeds: this is deferred to a later check for the VxTwitter case. This commit doesn't change the cog name; this will be done in a follow up. * [VxTwit] Use Enum for SocialMedia * [VxTwit] Remove unnecessary debug statement * [VxTwit] Sort the imports * [VxTwit] Move INSTA_REGEX_MATCH to constants.py * [VxTwit] Refactor urls_to_string Co-authored-by: Dat Quach <quachtridat@yahoo.com.vn> * [VxTwit] Fix docstrings * [VxTwit] Compile regex pattern Co-authored-by: Dat Quach <quachtridat@yahoo.com.vn> * [VxTwit] Add on_message_edit listener for instagram
- Loading branch information
Showing
4 changed files
with
109 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
KEY_ENABLED = "enabled" | ||
import enum | ||
import re | ||
|
||
KEY_ENABLED = "enabled" | ||
DEFAULT_GUILD = {KEY_ENABLED: False} | ||
INSTA_REGEX_PATTERN = re.compile(r"https://(?:www\.)?(instagram.com)") | ||
|
||
|
||
class SocialMedia(enum.Enum): | ||
INSTAGRAM = "Instagram" | ||
TWITTER = "Twitter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters