Table of contents
This page is generated from
docs/cog_guides/image.rst- please edit the source file instead of this page.
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>
Installation Guides
- Installing Red
- Creating a bot account
- Updating Red
- Backing Up and Restoring Red
- About Virtual Environments
- Setting up auto-restart using batch on Windows
- Setting up auto-restart on Mac
- Setting up auto-restart using systemd on Linux
Cog Reference
User guides
- Getting started
- Running Red on Fluxer
- About Privileged Intents
- About public (big) bots
- Admin
- Alias
- Audio
- Cleanup
- Cog Manager UI
- Core
- CustomCommands
- Dev
- Downloader
- Economy
- Filter
- General
- Image
- Permissions
- Mod
- ModLog
- Mutes
- Reports
- Streams
- Trivia
- Warnings
- Red and End User Data
Cog Creation Guides
- Creating cogs for Red
- Slash Commands and Interactions
- Publishing cogs for Red
- Becoming an Approved Cog Creator
- Versioning
- End-user Guarantees
- Developer Guarantees
- Breaking Change Notices
Cog Development Framework Reference
- Shared API Keys
- Bank
- Bot
- Command Check Decorators
- App Command Check Decorators
- Commands Package
- App Commands Package
- Config
- Data Manager
- Custom Events
- Internationalization Framework
- Mod log
- RPC
- Tree
- Utility Functions
Others
Legacy (Red V2)