mirror of
https://github.com/dizedev/Main-tech.git
synced 2026-09-16 21:58:48 +00:00
super edit thay mama
This commit is contained in:
@@ -6,7 +6,7 @@ class AboutCommand(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="about")
|
||||||
async def about(self, ctx: disnake.AppCommandInteraction):
|
async def about(self, ctx: disnake.AppCommandInteraction):
|
||||||
embed = disnake.Embed(title='О боте', description='Многофункциональный бот.', color=0x00ff00)
|
embed = disnake.Embed(title='О боте', description='Многофункциональный бот.', color=0x00ff00)
|
||||||
embed.set_author(name='Hyper Tech')
|
embed.set_author(name='Hyper Tech')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class AvatarCommand(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="avatar")
|
||||||
async def avatar(self, ctx: disnake.AppCommandInteraction, member: disnake.Member = None):
|
async def avatar(self, ctx: disnake.AppCommandInteraction, member: disnake.Member = None):
|
||||||
if not member:
|
if not member:
|
||||||
member = ctx.author
|
member = ctx.author
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@ class BanCommands(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command(description="Изгоняет указанного участника с сервера навсегда.")
|
@commands.slash_command(name="ban", description="Изгоняет указанного участника с сервера навсегда.")
|
||||||
async def ban(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, *, reason=None):
|
async def ban(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, *, reason=None):
|
||||||
if disnake.utils.get(ctx.author.roles, id=1060542125621649458):
|
if disnake.utils.get(ctx.author.roles, id=1060542125621649458):
|
||||||
await member.ban(reason=reason)
|
await member.ban(reason=reason)
|
||||||
@@ -15,8 +15,8 @@ class BanCommands(commands.Cog):
|
|||||||
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060542125621649458>.')
|
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060542125621649458>.')
|
||||||
|
|
||||||
@commands.has_any_role(1060542125621649458)
|
@commands.has_any_role(1060542125621649458)
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="unban")
|
||||||
async def unban(ctx: disnake.AppCommandInteraction, *, user: disnake.User):
|
async def unban(self, ctx: disnake.AppCommandInteraction, *, user: disnake.User):
|
||||||
if disnake.utils.get(ctx.author.roles, id=1060542125621649458):
|
if disnake.utils.get(ctx.author.roles, id=1060542125621649458):
|
||||||
await ctx.guild.unban(user)
|
await ctx.guild.unban(user)
|
||||||
if (user.name, user.discriminator) == (user.name, user.discriminator):
|
if (user.name, user.discriminator) == (user.name, user.discriminator):
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class CoinsCommand(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="coins")
|
||||||
async def coins(self, ctx: disnake.AppCommandInteraction):
|
async def coins(self, ctx: disnake.AppCommandInteraction):
|
||||||
coin = ["Орел", "Решка"]
|
coin = ["Орел", "Решка"]
|
||||||
result = random.choice(coin)
|
result = random.choice(coin)
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ class HelpCommand(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="commands")
|
||||||
async def commands(self, ctx: disnake.AppCommandInteraction):
|
async def commands(self, ctx: disnake.AppCommandInteraction):
|
||||||
embed = disnake.Embed(title="Помощь по командам", description="Вот список всех моих команд и их описания:")
|
embed = disnake.Embed(title="Помощь по командам", description="Вот список всех моих команд и их описания:")
|
||||||
embed.add_field(name="/help", value="Показывает список всех доступных команд.")
|
embed.add_field(name="/help", value="Показывает список всех доступных команд.")
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ class DogCommands(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="dog")
|
||||||
async def dog(self, ctx: disnake.AppCommandInteraction):
|
async def dog(self, ctx: disnake.AppCommandInteraction):
|
||||||
response = requests.get('https://dog.ceo/api/breeds/image/random')
|
response = requests.get('https://dog.ceo/api/breeds/image/random')
|
||||||
img_url = response.json()['message']
|
img_url = response.json()['message']
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class MagicBallCommand(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command(description="Даёт верные ответы на все ваши вопросы.")
|
@commands.slash_command(name="ball", description="Даёт верные ответы на все ваши вопросы.")
|
||||||
async def ball(self, ctx: disnake.AppCommandInteraction, *, question):
|
async def ball(self, ctx: disnake.AppCommandInteraction, *, question):
|
||||||
answers = [
|
answers = [
|
||||||
"Я не знаю.",
|
"Я не знаю.",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class MathCommands(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="math")
|
||||||
async def math(self, ctx: disnake.AppCommandInteraction, *, equation):
|
async def math(self, ctx: disnake.AppCommandInteraction, *, equation):
|
||||||
try:
|
try:
|
||||||
result = eval(equation)
|
result = eval(equation)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class PingCommands(commands.Cog):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.has_any_role(1091637465858715648)
|
@commands.has_any_role(1091637465858715648)
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="ping")
|
||||||
async def ping(self, ctx: disnake.AppCommandInteraction):
|
async def ping(self, ctx: disnake.AppCommandInteraction):
|
||||||
if disnake.utils.get(ctx.author.roles, id=1091637465858715648):
|
if disnake.utils.get(ctx.author.roles, id=1091637465858715648):
|
||||||
if ctx.channel.id == 1060544039767789639:
|
if ctx.channel.id == 1060544039767789639:
|
||||||
|
|||||||
+11
-11
@@ -8,39 +8,39 @@ class MuteCommands(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.slash_command(description="Заглушает по всему серверу на указанное время.")
|
@commands.slash_command(name="mute", description="Заглушает по всему серверу на указанное время.")
|
||||||
@commands.has_permissions(manage_roles=True)
|
@commands.has_permissions(manage_roles=True)
|
||||||
async def mute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, time: int, *, reason=None):
|
async def mute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member, time: int, *, reason=None):
|
||||||
if disnake.utils.get(ctx.author.roles, id=1060541642450411560):
|
if disnake.utils.get(ctx.author.roles, id=1060541642450411560):
|
||||||
guild = ctx.guild
|
guild = ctx.guild
|
||||||
mutedRole = disnake.utils.get(guild.roles, name="Muted")
|
muted_role = disnake.utils.get(guild.roles, name="Muted")
|
||||||
|
|
||||||
if not mutedRole:
|
if not muted_role:
|
||||||
mutedRole = await guild.create_role(name="Muted")
|
muted_role = await guild.create_role(name="Muted")
|
||||||
|
|
||||||
# Проверка роли на каждый чат
|
# Проверка роли на каждый чат
|
||||||
for channel in guild.channels:
|
for channel in guild.channels:
|
||||||
await channel.set_permissions(mutedRole, speak=False, send_messages=False)
|
await channel.set_permissions(muted_role, speak=False, send_messages=False)
|
||||||
|
|
||||||
await member.add_roles(mutedRole, reason=reason)
|
await member.add_roles(muted_role, reason=reason)
|
||||||
await ctx.send(f"{member.mention} был замучен на {time} секунд. Причина: {reason}.")
|
await ctx.send(f"{member.mention} был замучен на {time} секунд. Причина: {reason}.")
|
||||||
await asyncio.sleep(time)
|
await asyncio.sleep(time)
|
||||||
await member.remove_roles(mutedRole)
|
await member.remove_roles(muted_role)
|
||||||
await ctx.send(f"{member.mention} больше не замучен.")
|
await ctx.send(f"{member.mention} больше не замучен.")
|
||||||
else:
|
else:
|
||||||
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
|
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
|
||||||
|
|
||||||
@commands.slash_command(description="Снимает мут с указанного пользователя.")
|
@commands.slash_command(name="unmute", description="Снимает мут с указанного пользователя.")
|
||||||
@commands.has_permissions(manage_roles=True)
|
@commands.has_permissions(manage_roles=True)
|
||||||
async def unmute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
async def unmute(self, ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
||||||
if disnake.utils.get(ctx.author.roles, id=1060541642450411560):
|
if disnake.utils.get(ctx.author.roles, id=1060541642450411560):
|
||||||
mutedRole = disnake.utils.get(ctx.guild.roles, name="Muted")
|
muted_role = disnake.utils.get(ctx.guild.roles, name="Muted")
|
||||||
|
|
||||||
if mutedRole not in member.roles:
|
if muted_role not in member.roles:
|
||||||
await ctx.send(f"{member.mention} не замучен.")
|
await ctx.send(f"{member.mention} не замучен.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await member.remove_roles(mutedRole)
|
await member.remove_roles(muted_role)
|
||||||
await ctx.send(f"{member.mention} больше не замучен.")
|
await ctx.send(f"{member.mention} больше не замучен.")
|
||||||
else:
|
else:
|
||||||
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
|
await ctx.send(f'{ctx.author.mention}, у вас нет роли <@&1060541642450411560>.')
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class TicketsCommand(commands.Cog):
|
|||||||
|
|
||||||
ticket_channel = None
|
ticket_channel = None
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="ticket")
|
||||||
@commands.has_permissions(manage_channels=True)
|
@commands.has_permissions(manage_channels=True)
|
||||||
async def ticket(self, ctx: disnake.AppCommandInteraction):
|
async def ticket(self, ctx: disnake.AppCommandInteraction):
|
||||||
global ticket_channel
|
global ticket_channel
|
||||||
@@ -24,7 +24,7 @@ class TicketsCommand(commands.Cog):
|
|||||||
except:
|
except:
|
||||||
await ctx.send('Ошибка при создании канала. Пожалуйста, попробуйте позже.')
|
await ctx.send('Ошибка при создании канала. Пожалуйста, попробуйте позже.')
|
||||||
|
|
||||||
@commands.slash_command()
|
@commands.slash_command(name="close_ticket")
|
||||||
@commands.has_permissions(manage_channels=True)
|
@commands.has_permissions(manage_channels=True)
|
||||||
async def close_ticket(self, ctx: disnake.AppCommandInteraction):
|
async def close_ticket(self, ctx: disnake.AppCommandInteraction):
|
||||||
global ticket_channel
|
global ticket_channel
|
||||||
|
|||||||
@@ -8,18 +8,33 @@ intents = disnake.Intents.all()
|
|||||||
bot = commands.Bot(command_prefix="$", intents=intents)
|
bot = commands.Bot(command_prefix="$", intents=intents)
|
||||||
|
|
||||||
|
|
||||||
|
# Функция сохранения данных пользователя в JSON
|
||||||
|
def save_data(user, data):
|
||||||
|
with open(f'./users/{user.id}.json', 'w') as file:
|
||||||
|
json.dump(data, file)
|
||||||
|
|
||||||
|
|
||||||
|
# Функция загрузки данных пользователя из файла JSON
|
||||||
|
def load_data(user):
|
||||||
|
try:
|
||||||
|
with open(f'./users/{user.id}.json', 'r') as file:
|
||||||
|
return json.load(file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print("Bot is ready")
|
print("Bot is ready")
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command(name="super_secret_command")
|
||||||
async def secret(ctx):
|
async def secret(ctx):
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
await ctx.send(f'Привет, {ctx.author.mention}. Это тайное сообщение!')
|
await ctx.send(f'Привет, {ctx.author.mention}. Это тайное сообщение!')
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command(name="news")
|
||||||
async def news(ctx):
|
async def news(ctx):
|
||||||
# Ваш код для получения новостей
|
# Ваш код для получения новостей
|
||||||
page_news = [
|
page_news = [
|
||||||
@@ -43,42 +58,30 @@ async def news(ctx):
|
|||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command(name="setmoderator")
|
||||||
@commands.has_guild_permissions(administrator=True)
|
@commands.has_guild_permissions(administrator=True)
|
||||||
async def set_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
async def set_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
||||||
member = member or ctx.message.author
|
member = member or ctx.message.author
|
||||||
guild = bot.get_guild(1060537877982887957)
|
guild = bot.get_guild(1060537877982887957)
|
||||||
role = guild.get_role(1060541642450411560)
|
role = guild.get_role(1060541642450411560)
|
||||||
|
|
||||||
await member.add_roles(role)
|
await member.add_roles(role)
|
||||||
await ctx.send(f"Пользователю {member.mention} была выдана роль {role.mention}")
|
await ctx.send(f"Пользователю {member.mention} была выдана роль {role.mention}")
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command(name="deletemoderator")
|
||||||
@commands.has_guild_permissions(administrator=True)
|
@commands.has_guild_permissions(administrator=True)
|
||||||
async def dellmoderator(ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
async def delete_moderator(ctx: disnake.AppCommandInteraction, member: disnake.Member):
|
||||||
member = member or ctx.message.author
|
member = member or ctx.message.author
|
||||||
guild = bot.get_guild(1060537877982887957)
|
guild = bot.get_guild(1060537877982887957)
|
||||||
role = guild.get_role(1060541642450411560)
|
role = guild.get_role(1060541642450411560)
|
||||||
|
|
||||||
await member.remove_roles(role)
|
await member.remove_roles(role)
|
||||||
await ctx.send(f"Пользователю {member.mention} была снята роль {role.mention}")
|
await ctx.send(f"Пользователю {member.mention} была снята роль {role.mention}")
|
||||||
|
|
||||||
|
|
||||||
def save_data(user, data):
|
|
||||||
with open(f'./users/{user.id}.json', 'w') as file:
|
|
||||||
json.dump(data, file)
|
|
||||||
|
|
||||||
|
|
||||||
# Функция загрузки данных пользователя из файла JSON
|
|
||||||
def load_data(user):
|
|
||||||
try:
|
|
||||||
with open(f'./users/{user.id}.json', 'r') as file:
|
|
||||||
return json.load(file)
|
|
||||||
except FileNotFoundError:
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
# Создание команды регистрации
|
# Создание команды регистрации
|
||||||
@bot.command()
|
@bot.command(name="register")
|
||||||
async def register(ctx: disnake.AppCommandInteraction, name):
|
async def register(ctx: disnake.AppCommandInteraction, name):
|
||||||
# Проверка, был ли пользователь уже зарегистрирован
|
# Проверка, был ли пользователь уже зарегистрирован
|
||||||
data = load_data(ctx.author)
|
data = load_data(ctx.author)
|
||||||
@@ -94,7 +97,7 @@ async def register(ctx: disnake.AppCommandInteraction, name):
|
|||||||
|
|
||||||
|
|
||||||
# Создание команды для просмотра баланса
|
# Создание команды для просмотра баланса
|
||||||
@bot.command()
|
@bot.command(name="balance")
|
||||||
async def balance(ctx):
|
async def balance(ctx):
|
||||||
# Загрузка данных пользователя из файла JSON
|
# Загрузка данных пользователя из файла JSON
|
||||||
data = load_data(ctx.author)
|
data = load_data(ctx.author)
|
||||||
@@ -107,7 +110,7 @@ async def balance(ctx):
|
|||||||
await ctx.send(f'{ctx.author.mention}, ваш текущий баланс: {data["coins"]}')
|
await ctx.send(f'{ctx.author.mention}, ваш текущий баланс: {data["coins"]}')
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command(name="pay")
|
||||||
async def pay(ctx: disnake.AppCommandInteraction, recipient: disnake.User, amount: int):
|
async def pay(ctx: disnake.AppCommandInteraction, recipient: disnake.User, amount: int):
|
||||||
# Загрузка данных отправителя из файла JSON
|
# Загрузка данных отправителя из файла JSON
|
||||||
sender_data = load_data(ctx.author)
|
sender_data = load_data(ctx.author)
|
||||||
@@ -145,4 +148,4 @@ for filename in os.listdir("./cogs"):
|
|||||||
if filename.endswith(".py"):
|
if filename.endswith(".py"):
|
||||||
bot.load_extension(f"cogs.{filename[:-3]}")
|
bot.load_extension(f"cogs.{filename[:-3]}")
|
||||||
|
|
||||||
bot.run("MTA5ODk5MzExMjI5NjE5NDA3MA.GUj8WN.16iwjYtaouRXbsfJhCi1U7fa75ehLFb7YRbEnU")
|
bot.run(settings.DISCORD_TOKEN)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
DISCORD_TOKEN = "MTA5ODk5MzExMjI5NjE5NDA3MA.GUj8WN.16iwjYtaouRXbsfJhCi1U7fa75ehLFb7YRbEnU"
|
||||||
Reference in New Issue
Block a user