by we

EmbedGen Bot

Test this app for free
45
import os
import discord
from discord.ext import commands
from abilities import llm

def generate_oauth_link(client_id):
    base_url = "https://discord.com/api/oauth2/authorize"
    redirect_uri = "http://localhost"
    scope = "bot"
    permissions = "8"  # Administrator permission for simplicity, adjust as needed.
    return f"{base_url}?client_id={client_id}&permissions={permissions}&scope={scope}"

def start_bot(token):
    intents = discord.Intents.default()
    intents.messages = True
    intents.message_content = True
    bot = commands.Bot(command_prefix='!', intents=intents)
    bot.embed_cache = {}

    @bot.event
    async def on_ready():
        print(f'Bot is ready. Logged in as {bot.user}')

    @bot.command()
Get full code

Created: | Last Updated:

Discord bot for generating embeds using a simple command. !embed a tweet previewer

Here's a step-by-step guide for using the EmbedGen Bot template:

Introduction to the EmbedGen Bot Template

The EmbedGen Bot is a Discord bot that allows users to generate custom embeds using a simple command. This bot can create visually appealing and informative embeds based on user prompts, making it easier to share information in Discord servers.

Getting Started

  1. Click "Start with this Template" to begin using the EmbedGen Bot template in Lazy.

  2. Set up the required environment secrets:

  3. In the Lazy Builder interface, navigate to the Environment Secrets tab.
  4. Add the following secrets:
    • CLIENT_ID: Your Discord application's client ID
    • BOT_TOKEN: Your Discord bot token

To obtain these values: - Go to the Discord Developer Portal (https://discord.com/developers/applications) - Create a new application or select an existing one - Navigate to the "Bot" section and click "Add Bot" if you haven't already - Under the "TOKEN" section, click "Copy" to get your BOT_TOKEN - Go to the "OAuth2" section and copy the "CLIENT ID"

Testing the Bot

  1. Click the "Test" button in the Lazy Builder interface to start the deployment process.

  2. Once the deployment is complete, you'll see an OAuth link printed in the console. Use this link to invite the bot to your Discord server.

Using the EmbedGen Bot

  1. In your Discord server, you can now use the following commands:

  2. To create an embed: !embed [your prompt] For example: !embed a tweet previewer

  3. To reuse a previously created embed: !grab [message_id] Replace [message_id] with the ID of the message containing the embed you want to reuse.

  4. The bot will generate an embed based on your prompt using AI. The embed will include a title, description, color, and relevant fields.

  5. After creating an embed, the bot will provide a message with the embed's ID, which you can use with the !grab command to reuse it later.

Integrating the Bot

No additional integration steps are required. Once the bot is invited to your Discord server, it will be ready to use with the commands mentioned above.

Remember to manage the bot's permissions in your Discord server settings to ensure it has the necessary access to read messages and send embeds in the desired channels.

Technologies

Discord Automation & Bots Discord Automation & Bots

Similar templates

We found some blogs you might like...