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

Consolidate author, git and version commands #50

Merged
merged 2 commits into from
May 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def get_tokens():

# Functional constants
PREFIX = "!c "
AUTHOR = "This bot is maintained by Appelsiini1"
GIT = "Source code for this bot can be found at https://github.com/Appelsiini1/CoraBot"
DB_F = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "Databases", "database.db"
)
Expand Down Expand Up @@ -66,4 +64,4 @@ def start(self):


# Version number
VERSION = "v1.14.8"
VERSION = "v1.14.9"
18 changes: 12 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ async def on_message(message):
await message.channel.send("Hello!")
elif cmd == "help":
await commands.cmds(message)
elif cmd == "author":
await message.channel.send(AUTHOR)
elif cmd == "git":
await message.channel.send(GIT)
elif cmd == "version":
await message.channel.send(f"CoraBot `{VERSION}`")
elif cmd in ["author", "git", "version"]:
await message.channel.send("This command has been depricated and will be removed soon. Use `!c info` instead.")
elif cmd == "info":
emb = discord.Embed()
emb.title = "CoraBot Info"
emb.description = f"**Created by** Appelsiini1\nThe source code & development info for this bot can be found at https://github.com/Appelsiini1/CoraBot\n\nVersion: {VERSION}"
emb.color = common.get_hex_colour(cora_blonde=True)

try:
message.channel.send(embed=emb)
except discord.errors.Forbidden:
common.forbiddenErrorHandler(message)
elif cmd == "inspire":
await quote.get_quote(message)
elif cmd == "insult":
Expand Down
4 changes: 1 addition & 3 deletions modules/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
async def cmds(message):
cmd_list = """`hi` (alias: `hello`)
`help`
`author`
`git`
`version`
`info`
`inspire`
`insult [user]`
`f` (alias: `F`)
Expand Down