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 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

  1. Login (or create) a GIPHY account.

  2. Visit this page.

  3. Press ‘Create an App’.

  4. Click ‘Select API’, and then ‘Next Step’.

  5. Add an app name, for example ‘Red’.

  6. Add an app description, for example ‘Used for Red’s image cog’.

  7. Click ‘Create App’. You’ll need to agree to the GIPHY API terms.

  8. Copy the API Key.

  9. 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

  1. Login to (or create) an Imgur account.

  2. Visit this page.

  3. Add an app name for your application, for example ‘Red’.

  4. Select ‘Anonymous usage without user authorization’ for the auth type.

  5. Set the authorization callback URL to https://localhost

  6. Leave the app website blank.

  7. Enter a valid email address and a description.

  8. Check the captcha box and click next.

  9. Your Client ID will be on the next page.

  10. In Discord, run the following command:

    [p]set api imgur client_id <your_client_id_here>