import discord
from discord.ext import commands
import aiohttp
TOKEN = '*&$^$*&*@&($!)!(@$&*!@^$*&!^)@(_$!)@*&$'
bot = commands.Bot(command_prefix="!")
@bot.command()
async def craft(ctx, *, text):
http1=str('https://minecraft-inside.ru/crafting/#')
http2=str({text})
http3= http1+http2
await ctx.send(http3)
#Ссылка на крафт должна выглядеть так: https://minecraft-inside.ru/crafting/#Алмазный_блок
#А в чате ссылка вот такая: https://minecraft-inside.ru/crafting/#%7B%27Алмазный_блок%27%7D
bot.run(TOKEN)
Добавить комментарий
|
1 ответ
Нужно просто использовать f-строки
import discord
from discord.ext import commands
import aiohttp
TOKEN = '*&$^$*&*@&($!)!(@$&*!@^$*&!^)@(_$!)@*&$'
bot = commands.Bot(command_prefix="!")
@bot.command()
async def craft(ctx, *, text):
http = str(f"https://minecraft-inside.ru/crafting/#{text}")
await ctx.send(http)
bot.run(TOKEN)