import disnake as discord
from disnake.ext import commands
from disnake.utils import get
import asyncio
import random
import json
import time
bot = commands.InteractionBot()
bot = commands.AutoShardedBot(shard_count=1)
emb_color = 0x6456FF
@bot.slash_command(name = "unbaned")
async def __unbaned(inter: discord.CommandInteraction, user_id: str):
if user_id == inter.author:
await inter.response.send_message("Нельзя разбанить самого себя :/", ephemeral = True)
else:
try:
await inter.guild.unban(user_id)
embed = discord.Embed(color = emb_color)
embed.title = "Снятие бана"
embed.description = f"{inter.author} | {inter.author.mention} разбанил {user_id} | {user_id.mention}"
await inter.response.send_message(embed = embed)
except:
await inter.response.send_message("Пользователь не найден :(", ephemeral = True)
@bot.event
async def on_ready():
bot.ready = True
print('Bot connected')
while True:
await bot.change_presence(status=discord.Status.idle, activity=discord.Streaming(name = "S.help | Личный бот сервера", url="https://discord.gg/GhHkNN5XSc"))
@bot.slash_command(name = "embed-generator")
async def __embed_generator(inter: discord.CommandInteraction, title: str, description: str, name: str = None, value: str = None):
if name == None:
name = "-"
if value == None:
value = "-"
embed = discord.Embed(color = emb_color)
embed.title = title
embed.description = description
embed.add_field(
name = name,
value = value)
await inter.response.send_message(embed = embed)
@bot.slash_command(name = "kick")
@commands.default_member_permissions(kick_members=True)
async def __kick(inter: discord.CommandInteraction, member: discord.Member, reason: str = None):
if member == inter.author:
await inter.response.send_message("Вы не можете кикнуть сам себя!", ephemeral = True)
else:
if member == bot.user:
await inter.response.send_message("Я не могу кикнуть сам себя", ephemeral = True)
else:
if reason == None:
reason = "Не указана"
await inter.guild.kick(member)
embed = discord.Embed(color = emb_color)
embed.title = "Кик"
embed.add_field(
name = "Нарушитель:",
value = f"{member} \n{member.mention}")
embed.add_field(
name = "Модератор:",
value = f"{inter.author} \n{inter.author.mention}")
embed.add_field(
name = "Причина:",
value = f"{reason}")
await inter.response.send_message(embed = embed)
@bot.slash_command(name = "muted")
@commands.default_member_permissions(manage_roles=True)
async def __muted(inter: discord.CommandInteraction, user: discord.Member, reason:str = None):
if user == inter.author:
...
async def __ver(inter: discord.CommandInteraction, user: discord.Member = None):
if user == None:
user = inter.author
role = get(inter.guild.roles, name='️♀️verify')
if not role in user.roles:
await inter.response.send_message(embed = discord.Embed(title = f'<:locked:925401747772559481>️ | Верификация', description = f'{inter.author.mention} вы уже прошли верификацию \n> За доп.вопросами обратитесь к администрации'), ephemeral = True)
else:
invite = await inter.channel.create_invite()
msg = await inter.response.send_message("Вы успешно прошли верификацию", ephemeral = True)
await user.remove_roles(role)
from os import listdir
bot.run('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')