DEV Community

Discussion on: discord.py Project 4: ✍🏽Partnership Bot!

 
mikeywastaken profile image
terabyte.

Jeez, I did it in a rush. ctx.member should be ctx.author

Thread Thread
 
janakxd profile image
Janak

bro now no errors but when i try to confirm by clicking tick then nothing happens no error, no advertise :(
,btw thanks by reading this artical i learned how to use discord forms thanks a lot

Thread Thread
 
mikeywastaken profile image
terabyte.

Hmm, i'm unsure about what could be happening. Make sure that your channel ID is correct, and could you send your code? (excluding the token of course)

Thread Thread
 
janakxd profile image
Janak • Edited

yes

to send code i removed token and channel ids

from discord.ext import commands
import discord
from discord.ext.forms import Form, ReactConfirm

TOKEN = "token here"
intents = discord.Intents(messages=True, guilds=True)
bot = commands.Bot(command_prefix="!", intents=intents)

@bot.command()
async def partner(ctx):
    form = Form(ctx, "Partnership Request")
    form.add_question(
        "What's the invite link to your server?", # The question which it will ask
        "invitelink", # What the form will call the result of this question
        "invite" # The type the response should be
    )
    form.add_question(
        "What's a description of your server?",
        "description"
    )
    form.add_question(
        "What's your server's advertisement?",
        "advertisement"
    )
    results = await form.start()
    embed = discord.Embed(
        title=f"Partnership Request from {results.invitelink.guild.name}",
        description=f"**Description:** {results.description}",
    )
    embed.set_thumbnail(url=results.invitelink.guild.icon_url)
    embed.set_author(name=ctx.author, icon_url=ctx.author.avatar_url)
    partnershipreq = bot.get_channel("i removed channel id")
    prompt = await partnershipreq.send(embed=embed)

    confirm = ReactConfirm(user=ctx.author,message=prompt, bot=bot)
    accepted = await confirm.start()

    if accepted:
        partners = bot.get_channel("i removed channel id")
        em = discord.Embed(title=results.invitelink.guild.name,description=results.advertisement, color=0x2F3136)
        em.set_author(name=ctx.author, icon_url=ctx.author.avatar_url)
        em.set_thumbnail(url=results.invitelink.guild.icon_url)
        await partners.send(embed=em)


bot.run(TOKEN)
Enter fullscreen mode Exit fullscreen mode