import discord
import requests as requests
from discord.ext import commands
import json
import requests
bot = commands.Bot(command_prefix='*')
@bot.command()
async def kiska(ctx):
await ctx.send('Нету кисок:3')
bot.remove_command('info')
@bot.command()
async def info(ctx):
embed = discord.Embed(title="У нас есть бот поддержки в телеграме", description="@shluba_bot")
embed.set_footer(text="Иногда бот может не ответить")
await ctx.send(embed=embed)
bot.remove_command('help')
@bot.command()
async def help(ctx):
embed = discord.Embed(title="Список комманд")
embed.add_field(name="*kotik", value="Показвает котика:3", inline=True)
embed.add_field(name="*kiska", value="Пока-что в бете", inline=True)
embed.add_field(name="*info", value="Обратиться в поддержку", inline=True)
await ctx.send(embed=embed)
@bot.command()
async def fox(ctx):
response = requests.get('https://some-random-api.ml/img/fox') # Get-запрос
json_data = json.loads(response.text) # Извлекаем JSON
embed = discord.Embed(color=0xff9900, title='Random Fox') # Создание Embed'a
embed.set_image(url=json_data['link']) # Устанавливаем картинку Embed'a
await ctx.send(embed=embed) # Отправляем Embed
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "fox" is not found
您从行首移动了命令,
你必须这样:
就是这样!