Discord webhook с врезкой - PullRequest
       101

Discord webhook с врезкой

0 голосов
/ 15 апреля 2020

Я сделал несколько команд для моего бота. Когда я посылаю команду .y или .j6 во второй раз, она выталкивает первую со второй. Как я могу это исправить?

(мне нужно опубликовать больше деталей, но у меня их нет, поэтому я пишу это, поэтому я могу опубликовать это, поэтому не читайте это, потому что это tra sh)

import discord
from discord.ext import commands
from discord_webhook import DiscordWebhook, DiscordEmbed

async def on_ready():
    print('Bot is ready.')

client = commands.Bot(command_prefix= '.')
webhook_urls = ['https://discordapp.com/api/webhooks/694265463936647289/zwRbi6A_jHp9r7kbTwOlWir9rS3-cXtMa6XLHHmrzwgyJtQaLPiisbSQBRgq7v39F6MG', 'https://discordapp.com/api/webhooks/699705671440138291/52awf2UE2TgVhumFQKp8ZOo-lz4iBtjt786NC1W1TDElAKCx4spXLP3RNi7O4avuQpHo']
webhook = DiscordWebhook(url=webhook_urls)


@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! {round(client.latency * 1000)}ms')

@client.command()
async def raffle(ctx, link, store, sneaker, raffletype ):
    channel = client.get_channel(642837709198721034)
    embed = discord.Embed(
        title=sneaker,
        description=store,
        url=link,
        colour=discord.Colour.blue()

    )
    embed.add_field(name="Release type", value=raffletype)

    embed.set_footer(text='The Hypesply | Chip#4600')

    await channel.send(embed=embed)

@client.command()
@commands.has_role('Owner')
async def j6(ctx, link, store, raffletype ):
    embed = DiscordEmbed(
        title="Nike AirJordan 6 'DMP'",
        url=link,
        colour=discord.Colour.blue()
    )
    embed.add_embed_field(name="Store", value=store)
    embed.add_embed_field(name="Release type", value=raffletype)
    embed.set_thumbnail(url="https://static.sneakerjagers.com/products/660x660/126329.jpg")
    embed.set_footer(text='The Hypesply | Chip#4600')
    webhook.add_embed(embed)
    webhook.execute()

@client.command()
@commands.has_role('Owner')
async def y(ctx, link, store, raffletype):
    embed = DiscordEmbed(
            title="Adidas Yeezyboost 350 V2 'Linen'",
            url=link,
            colour=discord.Colour.blue()
        )
    embed.add_embed_field(name="Store", value=store)
    embed.add_embed_field(name="Release type", value=raffletype)
    embed.set_thumbnail(url="https://static.sneakerjagers.com/products/660x660/155433.jpg")
    embed.set_footer(text='The Hypesply | Chip#4600')
    webhook.add_embed(embed)
    webhook.execute()```
...