mirror of
https://github.com/jeantoulza/scplanner-discord
synced 2024-11-21 19:15:38 +01:00
Update bot.py
Grammar & adjusting user error messages
This commit is contained in:
parent
2c477f150a
commit
bf53c6033f
8
bot.py
8
bot.py
@ -108,7 +108,7 @@ def auto(track_url):
|
|||||||
rep_json = json.loads(rep)
|
rep_json = json.loads(rep)
|
||||||
if not isinstance(rep_json, list):
|
if not isinstance(rep_json, list):
|
||||||
if rep_json["title"] == "Error S-788":
|
if rep_json["title"] == "Error S-788":
|
||||||
raise Exception("You have probably set use_all_accounts to 'no' and haven't set your account preferences. Please set them here: https://scplanner.net/account")
|
raise Exception("You have probably set use_all_accounts to 'no' and have not set your account preferences. Please set them here: https://scplanner.net/account")
|
||||||
else:
|
else:
|
||||||
print(rep_json)
|
print(rep_json)
|
||||||
raise Exception("Unknown error. Please fill an issue on https://github.com/jeantoulza/scplanner-discord.")
|
raise Exception("Unknown error. Please fill an issue on https://github.com/jeantoulza/scplanner-discord.")
|
||||||
@ -150,11 +150,11 @@ def start_bot():
|
|||||||
"""Reposts an URL on SCPlanner."""
|
"""Reposts an URL on SCPlanner."""
|
||||||
user = ctx.message.author
|
user = ctx.message.author
|
||||||
if not isinstance(user, discord.Member):
|
if not isinstance(user, discord.Member):
|
||||||
await bot.say("Please use this command in a server.")
|
await bot.say("Please use this command in a server that the bot is located in.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not has_role(user, config["CONFIG"]["reposters_role"]):
|
if not has_role(user, config["CONFIG"]["reposters_role"]):
|
||||||
await bot.say("You do no have the required role.")
|
await bot.say("You do not have the required role to repost or use this bot.")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
calendar_link = auto(url)
|
calendar_link = auto(url)
|
||||||
@ -166,4 +166,4 @@ def start_bot():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
start_bot()
|
start_bot()
|
||||||
#auto("https://soundcloud.com/toto/totooooo")
|
#auto("https://soundcloud.com/toto/totooooo")
|
||||||
|
Loading…
Reference in New Issue
Block a user