Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
@commands.slash_command(description = 'Показывает список команд')
async def help(self, interaction):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
pref = cur.execute(f'SELECT prefix FROM prefix WHERE guildid == ?', [interaction.guild.id]).fetchone()
button = Button(label="Information", style=disnake.ButtonStyle.primary, emoji='📄')
button1 = Button(label="Moderation", style=disnake.ButtonStyle.primary, emoji='🛠')
button2 = Button(label="Emoties", style=disnake.ButtonStyle.primary, emoji='😈')
view=View()
emb2 = disnake.Embed( title = f'Information', description = f'`{pref[0]}help` `{pref[0]}preds` `{pref[0]}slava` `{pref[0]}discord` `{pref[0]}nora` `{pref[0]}idea` `{pref[0]}say` `{pref[0]}words` `{pref[0]}gay` `{pref[0]}search` `{pref[0]}balance` `{pref[0]}youtube` `{pref[0]}history` `{pref[0]}convk` `{pref[0]}conteleg` `{pref[0]}coninst` `{pref[0]}emojify` `{pref[0]}price`', colour = disnake.Color.blue() )
async def button_callback(interaction):
await interaction.response.edit_message(embed=emb2)
button.callback = button_callback
emb3 = disnake.Embed( title = f'Moderation', description = f'`{pref[0]}mute` `{pref[0]}unmute` `{pref[0]}ban` `{pref[0]}unban` `{pref[0]}kick` `{pref[0]}clear` `$autoban` `{pref[0]}warn` `{pref[0]}sniat` `{pref[0]}list` `{pref[0]}change`', colour = disnake.Color.blue() )
async def button_callback(interaction):
await interaction.response.edit_message(embed=emb3)
button1.callback = button_callback
emb4 = disnake.Embed( title = f'Emoties', description = f'`{pref[0]}kanava` `{pref[0]}smoke` `{pref[0]}cuddle` `{pref[0]}kiss` `{pref[0]}clap` `{pref[0]}hit`', colour = disnake.Color.blue() )
async def button_callback(interaction):
await interaction.response.edit_message(embed=emb4)
button2.callback = button_callback
view.add_item(button)
view.add_item(button2)
view.add_item(button1)
emb = disnake.Embed( title = f'ᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠКоманды ботаᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠ', colour = disnake.Color.blue() )
await interaction.response.send_message(embed=emb, view=view, ephemeral=True)
@commands.command()
async def idea(self, ctx, *, message, amount = 1):
await ctx.channel.purge(limit = amount)
allowed_mentions = disnake.AllowedMentions(everyone = True)
emb = disnake.Embed( title = f'Новая идея by {ctx.author}', description = f'{message}', colour = disnake.Color.blue() )
emb.set_footer( text = ctx.author.name, icon_url = ctx.author.avatar)
message = await ctx.send('@everyone', embed=emb)
await message.add_reaction('✅')
await message.add_reaction('❌')
@idea.error
async def idea_error(self, ctx, error):
if isinstance ( error, commands.MissingRequiredArgument):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
pref = cur.execute(f'SELECT prefix FROM prefix WHERE guildid == ?', [ctx.guild.id]).fetchone()
gif1 = "https://images-ext-1.discordapp.net/external/fQhwLkamgTrE6eiSvEcFBv3JBZi_lH3RjPaNsBU_LFM/https/c.tenor.com/EfhPfbG0hnMAAAAC/slap-handa-seishuu.gif"
emb = disnake.Embed(description = f'{ctx.author.mention} напишите сообщение.', colour = disnake.Color.blue() )
emb.set_image(url=gif1)
await ctx.send ( embed = emb)
print(f"[Logs:error] Необходимо написать сообщение {ctx.author} | {pref[0]}idea")
intents = disnake.Intents.all()
def get_prefix(client, message):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
pref = cur.execute(f'SELECT prefix FROM prefix WHERE guildid == ?', [message.guild.id]).fetchone()
return pref
client = commands.Bot(command_prefix=get_prefix, intents=intents)
@commands.command()
async def gay(self, ctx, member:disnake.Member = None):
rnd = ['99', '100']
if member == None:
member=ctx.message.author
emb = disnake.Embed( title = 'Gay Check', description = f'🏳️🌈 {member.mention} gay on {random.randint(0, 100)}%', colour = disnake.Color.blue(), timestamp = ctx.message.created_at)
emb.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar)
await ctx.send(embed=emb)
import disnake
from disnake.ext import commands
import sqlite3
class Prefix(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
print('Module {} is loaded'.format(self.__class__.__name__))
@commands.Cog.listener()
async def on_guild_join(self, guild):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
base.execute('CREATE TABLE IF NOT EXISTS prefix(guildid INT, prefix TEXT)')
base.commit()
pref = cur.execute(f'SELECT guildid FROM prefix WHERE guildid == ?', [guild.id]).fetchone()
if pref == None:
cur.execute(f"INSERT INTO prefix VALUES (?, ?)", [guild.id, '*'])
base.commit()
else:
pass
@commands.Cog.listener()
async def on_guild_remove(self, guild):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
base.execute('CREATE TABLE IF NOT EXISTS prefix(guildid INT, prefix TEXT)')
base.commit()
cur.execute(f'DELETE FROM prefix WHERE guildid={guild.id}')
base.commit()
@commands.command()
@commands.has_permissions(administrator=True)
async def change(self, ctx, *, message):
base = sqlite3.connect('cogs/Warn.db')
cur = base.cursor()
base.execute('CREATE TABLE IF NOT EXISTS prefix(guildid INT, prefix TEXT)')
base.commit()
cur.execute('UPDATE prefix SET prefix == ? WHERE guildid == ?', [message, ctx.guild.id])
base.commit()
await ctx.send('Вы успешно изменили префикс')
def setup(client):
client.add_cog(Prefix(client))