Image
This is the cog guide for the image cog. You will find detailed docs about usage and commands.
[p]
is considered as your prefix.
Note
To use this cog, load it by typing this:
[p]load image
Usage
This cog provides commands for retrieving pictures from websites such as Giphy and Imgur.
Commands
Here’s a list of all commands available for this cog.
gif
Syntax
[p]gif <keywords...>
Description
Retrieve the first search result from Giphy. This command requires API tokens to be set via the giphycreds command.
Arguments
<keywords...>
: The keywords used to search Giphy.
gifr
Syntax
[p]gifr <keywords...>
Description
Retrieve a random GIF from a Giphy search. This command requires API tokens to be set via the giphycreds command.
Arguments
<keywords...>
: The keywords used to generate a random GIF.
imgur
Syntax
[p]imgur
Description
Retrieves pictures from Imgur. This command requires API tokens to be set via the imgurcreds command.
imgur search
Syntax
[p]imgur search [count=1] <terms...>
Description
Search for pictures on Imgur. This command requires API tokens to be set via the imgurcreds command.
Arguments
[count]
: How many images should be returned (maximum 5). Defaults to 1.<terms...>
: The terms used to search Imgur.
imgur subreddit
Syntax
[p]imgur subreddit <subreddit> [count=1] [sort_type=top] [window=day]
Description
Get images from a subreddit. This command requires API tokens to be set via the imgurcreds command.
Arguments
<subreddit>
: The subreddit to get images from.[count]
: The number of images to return (maximum 5). Defaults to 1.[sort_type]
: New, or top results. Defaults to top.[window]
: The timeframe, can be the past day, week, month, year or all. Defaults to day.
giphycreds
Note
This command is locked to the bot owner.
Syntax
[p]giphycreds
Description
Explains how to set GIPHY API tokens.
Getting your API key
Login (or create) a GIPHY account.
Visit this page.
Press ‘Create an App’.
Click ‘Select API’, and then ‘Next Step’.
Add an app name, for example ‘Red’.
Add an app description, for example ‘Used for Red’s image cog’.
Click ‘Create App’. You’ll need to agree to the GIPHY API terms.
Copy the API Key.
In Discord, run the following command:
[p]set api GIPHY api_key <your_api_key_here>
imgurcreds
Note
This command is locked to the bot owner.
Syntax
[p]imgurcreds
Description
Explains how to set Imgur API tokens.
Getting your API key
Login to (or create) an Imgur account.
Visit this page.
Add an app name for your application, for example ‘Red’.
Select ‘Anonymous usage without user authorization’ for the auth type.
Set the authorization callback URL to
https://localhost
Leave the app website blank.
Enter a valid email address and a description.
Check the captcha box and click next.
Your Client ID will be on the next page.
In Discord, run the following command:
[p]set api imgur client_id <your_client_id_here>