Skip to content

Commit

Permalink
Refactoring: Move discord twitter bot in a folder (#23)
Browse files Browse the repository at this point in the history
* refactoring: move in folders

* More detailed error information
  • Loading branch information
NNTin authored Sep 20, 2018
1 parent 024c3ec commit 96b5c0b
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,4 @@ $RECYCLE.BIN/
*.lnk
*.xml
.idea/discord-twitter-bot.iml
createJson.py
createJson2.py
info.py
info2.txt
test.py
info.txt
debug.json
debug.py
experiment/
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bot: python main.py
bot: python bot/main.py
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions main.py → bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,28 @@ def _on_status(self, status):
webhook.send(embed=embed, content=data_discord["custom_message"])
else:
webhook.send(embed=embed)
except discord.errors.NotFound as error:
print('---------Error---------')
print('discord.errors.NotFound')
print("The Webhook URL you provided does not exist.")
print(error)
print('-----------------------')
except discord.errors.Forbidden as error:
print('---------Error---------')
print('discord.errors.Forbidden')
print("The authorization token for your Webhook is incorrect.")
print(error)
print('-----------------------')
pass
except discord.errors.InvalidArgument as error:
print('---------Error---------')
print('discord.errors.InvalidArgument')
print("This should never happen. Contakt me https://discord.gg/JV5eUB "
"and send me what follows below:")
print(error)
print(data)
print('-----------------------')
pass
except discord.errors.HTTPException as error:
print('---------Error---------')
print('discord.errors.HTTPException')
Expand Down
16 changes: 0 additions & 16 deletions discord-twitter-bot.sh

This file was deleted.

0 comments on commit 96b5c0b

Please sign in to comment.