-
-
Notifications
You must be signed in to change notification settings - Fork 12
Feature/spooktober picture command #48
base: main
Are you sure you want to change the base?
Feature/spooktober picture command #48
Conversation
Add a command which displays a random image from r/spooktober
EDIT: but I see now that your code does not use the Reddit API, unlike you stated in the PR description. So this is basically scraping the subreddit. But using
Also another passage of the API rules:
That being said, I have implemented an authenticated implementation in my PR, you might pull some inspiration from that for this one. We might have to implement some rate limiting / caching towards the Reddit API though...
|
Thanks I will look at it :) |
@tmttn Hello again, I worked on the command to properly use Reddit API like you did (I used the same config format and module as your PR to avoid conflicts 👍 ) About the API usage, I couldn't figure out how to filter image posts properly, so I did it my way based on whether or not the url contains Finally, I don't really know how to avoid reaching the 60 requests limit for now. |
We need to prepare the reddit API in beforehand (server sided) so we can actually use it. :-) |
I have also discussed #42 and this one with @LucasCtrl and we came to the conclusion that in order to make these Reddit commands work, we'll have to decouple actual command executions from interacting with the Reddit API. My proposal is to cache the results we need, and call the API x times per hour to update this cache (or even x times per day). After having cached a number of results, we display a random one of those results. |
Merge changes
…lation_added_more Feature/german translation added more
Added Chinese, Arabic, and Turkish
…uage Update French language
Add a command which displays a random image from r/spooktober
…om/matteoauger/spookybot into feature/spooktober-picture-command
@matteoauger something looks off here, why are there so many commits visible in the PR? It looks like you didn't use |
My bad, it's actually my first time resolving a PR using command line only. |
Aims to close #47
What have been implemented
I added a command which displays a random picture from r/spooktober on the discord server.
Command name is the following :
boo!meme
.Example here :
How it's been implemented
I created a new command in the
commands/Picture
directory. This command usesaxios
module to asynchronously send requests toreddit API
. As long as the command only reads data from the API, no token or other auth is required for it to work.I hope you'll like it 👍