Compare commits
2 Commits
V2.0
...
1213e08c7b
Author | SHA1 | Date | |
---|---|---|---|
1213e08c7b
|
|||
8605f7f732
|
@ -1,4 +1,5 @@
|
|||||||
# The new [QuotesBot](https://bots.fyrfli.social/@quotesbot) code
|
# The new [QuotesBot](https://bots.fyrfli.social/@quotesbot) code
|
||||||
|

|
||||||
|
|
||||||
In the neverending quest to improve my coding skills, I often check out the code that other bots employ Last night, I decided to check out the code for the [ThursdayBot](https://github.com/devashishp/thursday) and realised something really neat:
|
In the neverending quest to improve my coding skills, I often check out the code that other bots employ Last night, I decided to check out the code for the [ThursdayBot](https://github.com/devashishp/thursday) and realised something really neat:
|
||||||
|
|
||||||
|
2
app.py
2
app.py
@ -17,5 +17,5 @@ if source_object.reason == "OK":
|
|||||||
print(choices[0])
|
print(choices[0])
|
||||||
choice = choices[randint(0, len(choices) - 1)]
|
choice = choices[randint(0, len(choices) - 1)]
|
||||||
headers = {'Authorization': 'Bearer ' + post_token}
|
headers = {'Authorization': 'Bearer ' + post_token}
|
||||||
payload = {'status': f"{choice['quote']}\n\n - {choice['author']}", 'privacy': 'public'}
|
payload = {'status': f"{choice['quote']}\n\n - {choice['author']}\n\n#RandomQuote #quotes #quote #bot", 'privacy': 'public'}
|
||||||
response = post(post_endpoint, headers=headers, data=payload)
|
response = post(post_endpoint, headers=headers, data=payload)
|
||||||
|
Reference in New Issue
Block a user