Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a004c3fbf | |||
| 4a042694d1 | |||
| fc12a74681 | |||
| fe38dec195 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
python-version: 3.7
|
||||
- name: Update Version
|
||||
id: semver
|
||||
uses: RightBrain-Networks/semver-action@1.0.0
|
||||
uses: RightBrain-Networks/semver-action@master
|
||||
with:
|
||||
mode: get
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/version.yml
vendored
2
.github/workflows/version.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@v1
|
||||
- name: Run Auto-Semver
|
||||
id: semver
|
||||
uses: RightBrain-Networks/semver-action@1.0.0
|
||||
uses: RightBrain-Networks/semver-action@master
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import discord, boto3, configparser, os, sys
|
||||
|
||||
version = "0.0.0"
|
||||
version = "0.0.2"
|
||||
|
||||
# Get token at: https://discord.com/developers/applications/
|
||||
config = configparser.ConfigParser()
|
||||
config_path = "discord_config.ini"
|
||||
|
||||
currently_enabled = True
|
||||
|
||||
if not os.path.exists(config_path):
|
||||
with open(config_path, "w") as file_writer:
|
||||
file_writer.write("""[discord]
|
||||
@@ -39,9 +41,29 @@ class Notifier(discord.Client):
|
||||
print(f"I see {message.author}")
|
||||
await message.channel.send(":eye: You have been seen! :eye:")
|
||||
|
||||
if str(message.author) in [str(self.user), "The Genuine Wonder#2859"]:
|
||||
if str(message.author) == config["discord"]["ignore_user"]:
|
||||
if str(message.channel) == "Direct Message":
|
||||
if message.content.lower() == "start":
|
||||
currently_enabled = True
|
||||
message.channel.send("Notifications were enabled")
|
||||
print("Notifications were enabled")
|
||||
elif message.content.lower() == "stop":
|
||||
currently_enabled = False
|
||||
print("Notifications were disabled")
|
||||
message.channel.send("Notifications were disabled")
|
||||
elif message.content.lower() == "status":
|
||||
if currently_enabled:
|
||||
message.channel.send("Notifications are currently enabled!")
|
||||
else:
|
||||
message.channel.send("Notifications are currently disabled!")
|
||||
else:
|
||||
print("Valid commands are 'START', 'STATUS', and 'STOP'")
|
||||
|
||||
|
||||
if str(message.author) in [str(self.user), config["discord"]["ignore_user"]]:
|
||||
return
|
||||
|
||||
if currently_enabled:
|
||||
# Format and print mesage
|
||||
formatted_message = f"<{message.author}> \"{message.content}\" from #{message.channel} on {message.guild}"
|
||||
print(formatted_message)
|
||||
|
||||
Reference in New Issue
Block a user