[refactor]: Delete unuseful commands

This commit is contained in:
Sweetbread 2023-05-09 00:18:20 +03:00
parent c39ac2bd1f
commit b0af0d724c
4 changed files with 1 additions and 133 deletions

26
bot.py
View File

@ -220,14 +220,6 @@ async def on_message(message):
await bot.process_commands(message) await bot.process_commands(message)
await on_message_handler(message) await on_message_handler(message)
@bot.command(pass_content=True)
async def mirror(ctx, time: int, *, atr):
await ctx.message.delete()
async with ctx.typing():
await asyncio.sleep(time)
await ctx.send(atr)
CSF = discord.Object(id=822157545622863902) CSF = discord.Object(id=822157545622863902)
@ -378,24 +370,6 @@ async def change_level(ctx, user: typing.Union[discord.Member, int], level):
await ctx.message.delete() await ctx.message.delete()
@bot.command()
async def change_lang(ctx, user: typing.Union[discord.Member, int], lang):
lang = lang.upper()
if 'int' in str(type(user)):
id_ = user
else:
id_ = user.id
if not lang in ("RU", "EN"):
await ctx.message.add_reaction(XX)
raise TypeError
db.members.update_one({"id": id_}, {"$set": {"language": lang}})
await ctx.message.add_reaction(check_mark)
await asyncio.sleep(3)
await ctx.message.delete()
@bot.command(aliases=["reload"], brief="Перезагружает бота") @bot.command(aliases=["reload"], brief="Перезагружает бота")
@commands.check(is_secret) @commands.check(is_secret)
async def reboot(ctx): async def reboot(ctx):

View File

@ -1,85 +0,0 @@
import discord
import requests
import uuid
import aiohttp
import asyncio
from discord.ext import commands
class Bridge(commands.Cog):
def __init__(self):
self.base_url = "https://www.guilded.gg/api"
self.session = aiohttp.ClientSession()
asyncio.create_task(self.meow())
async def meow(self):
await self.session.post(f"{self.base_url}/login", json={"email": "miyako@miyakobot.ru", "password": "miyakotb"})
@commands.Cog.listener()
async def on_message(self, message):
if message.guild is None: return
if message.guild.id != 822157545622863902: return
if message.channel.id == 822157545622863905:
channel_id = "e11508c9-b817-404d-8ac4-22ff288f8f48"
elif message.channel.id == 822582629390876762:
channel_id = "5b228995-ceb6-442a-b65e-162a797b5253"
elif message.channel.id == 864989115242250280:
channel_id = "7cd64e7d-2747-4cea-90a5-3c7b57c2b895"
elif message.channel.id == 977920558140379176:
channel_id = "15404706-85b8-45a0-b969-57394953917c"
else:
return
#await message.channel.send(f"{self.base_url}/channels/{channel_id}/messages")
nick = message.author.nick
if nick is None:
nick = message.author.name
json = {
"messageId": str(uuid.uuid4()),
"content": {
"object": "value",
"document": {
"object": "document",
"data": {},
"nodes": [{
"object": "block",
"type": "paragraph",
"nodes": [{
"object": "text",
"leaves": [{
"object": "leaf",
"text": nick,
"marks": [{
"data": {},
"object": "mark",
"type": "inline-code-v2"
}]
}]
}]
}, {
"object": "block",
"type": "paragraph",
"data": {},
"nodes": [{
"object": "text",
"leaves": [{
"object": "leaf",
"text": message.content,
"marks": []
}]
}]
}]
}
}
}
await self.session.post(f"{self.base_url}/channels/{channel_id}/messages", json=json)
async def setup(bot):
await bot.add_cog(Bridge())

View File

@ -15,12 +15,6 @@ class Slashes(Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@app_commands.command()
#@logger.catch
async def error(self, inter):
0/0
@app_commands.command(description="About this bot") @app_commands.command(description="About this bot")
async def about(self, inter): async def about(self, inter):
info_text = await self.bot.tree.translator.translate( info_text = await self.bot.tree.translator.translate(

View File

@ -13,6 +13,7 @@ class Stickers(commands.Cog, name="Стикеры"):
self.bot = bot self.bot = bot
@commands.command(aliases=["sl"]) @commands.command(aliases=["sl"])
@app_commands.guilds(discord.Object(822157545622863902))
async def sticker_list(self, ctx): async def sticker_list(self, ctx):
if ctx.guild is not None: if ctx.guild is not None:
color = ctx.guild.me.color color = ctx.guild.me.color
@ -26,22 +27,6 @@ class Stickers(commands.Cog, name="Стикеры"):
embed = discord.Embed(title="Стикеры", description="\n".join([f"{i+1}: {list_[i]}" for i in range(len(list_))]), color=color) embed = discord.Embed(title="Стикеры", description="\n".join([f"{i+1}: {list_[i]}" for i in range(len(list_))]), color=color)
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.command(name="send_sticker", aliases=["ss"])
async def _send_sticker(self, ctx, sticker: int, *, content=""):
if ctx.guild is not None:
color = ctx.guild.me.color
if color == discord.Color.default():
color = discord.Color(0xaaffaa)
else:
color = discord.Color(0xaaffaa)
embed = discord.Embed(color=color)
embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar)
with open(join(dir, listdir(dir)[sticker-1]), 'rb') as f:
await ctx.send(content, file=discord.File(f), embed=embed, reference=ctx.message.reference)
try: await ctx.message.delete()
except: pass
@app_commands.command(name="sticker", description="Отправляет стикер") @app_commands.command(name="sticker", description="Отправляет стикер")
@app_commands.guilds(discord.Object(822157545622863902)) @app_commands.guilds(discord.Object(822157545622863902))
@app_commands.describe(sticker="Стикер") @app_commands.describe(sticker="Стикер")