I want to make a link to the discord server, but the link is not clickable. What to do?
I want to make a link to the discord server, but the link is not clickable. What to do? My code:
@bot.command()
async def help(ctx):
embed = discord.Embed(color=0x232323, title='Навигация по командам')
embed.add_field(name=':eyes:Информация о боте', value='.info')
embed.add_field(name=':detective:Утилиты', value='.utilities')
embed.add_field(name=':video_game:Интересная игра', value='.game')
embed.add_field(name=':hammer_pick:Команды модерации', value='.moderation')
embed.add_field(name=':radio:Пинг', value='.ping')
embed.add_field(name='Добавить бота на свой сервер', value='[Ссылка на добавление](https://discord.com/api/oauth2/authorize?client_id=794873293148651564&permissions=8&scope=bot)', inline=False)
embed.add_field(name='Оффициальный сервер бота', value='[Клик](https://discord.com/invite/urvGgmn5Fw)', inline=False)
await ctx.send(embed=embed)```
0
1 answers
I suggest doing this via Cog
Create a file in the same folder as the main file of the bot, with the name, for example, help.py and insert the code below:
import discord
from discord.ext import commands
from discord import utils
from discord.utils import get
import os
class Help(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.invite = ''# ссылка на добавления бота
self.server = ''# ссылка на сервер
@commands.command()
async def help(self, ctx):
embed=discord.Embed(
title="Навигация по командам",
timestamp = ctx.message.created_at,
color = 0x232323
)
embed.add_field(
name = ':eyes:Информация о боте',
value = '.info'
)
embed.add_field(
name = ":detective:Утилиты",
value = ".utilities",
inline = False
)
embed.add_field(
name = ":video_game:Интересная игра",
value = ".game",
inline = False
)
embed.add_field(
name = ":hammer_pick:Команды модерации",
value = ".moderation",
inline = True
)
embed.add_field(
name = ":radio:Пинг",
value = ".ping",
inline = True
)
embed.add_field(
name = "Добавить бота на свой сервер",
value = "[Ссылка на добавление]({0.invite})".format(self),
inline = False
)
embed.add_field(
name = "Оффициальный сервер бота",
value = "[Клик]({0.server})".format(self),
inline = False
)
await ctx.send(embed = embed)
def setup(bot):
bot.add_cog(Help(bot))
Then in the main file of the bot you write the following:
bot.load_extension('cog.help')#здесь вам нужно указать путь к файлу, к примеру у вас папка называется cog
0
Author: xZartsust, 2021-01-28 09:16:50