diff --git a/bot.py b/bot.py index d7ce755..bb7acff 100755 --- a/bot.py +++ b/bot.py @@ -220,14 +220,6 @@ async def on_message(message): await bot.process_commands(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) @@ -378,24 +370,6 @@ async def change_level(ctx, user: typing.Union[discord.Member, int], level): 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="Перезагружает бота") @commands.check(is_secret) async def reboot(ctx): diff --git a/cogs/bridge.py b/cogs/bridge.py deleted file mode 100644 index 43cd622..0000000 --- a/cogs/bridge.py +++ /dev/null @@ -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()) - - diff --git a/cogs/slashes.py b/cogs/slashes.py index 1d0f078..ff5de4b 100644 --- a/cogs/slashes.py +++ b/cogs/slashes.py @@ -15,12 +15,6 @@ class Slashes(Cog): def __init__(self, bot): self.bot = bot - @app_commands.command() - #@logger.catch - async def error(self, inter): - 0/0 - - @app_commands.command(description="About this bot") async def about(self, inter): info_text = await self.bot.tree.translator.translate( diff --git a/cogs/stickers.py b/cogs/stickers.py index 254f3a5..18b9421 100644 --- a/cogs/stickers.py +++ b/cogs/stickers.py @@ -13,6 +13,7 @@ class Stickers(commands.Cog, name="Стикеры"): self.bot = bot @commands.command(aliases=["sl"]) + @app_commands.guilds(discord.Object(822157545622863902)) async def sticker_list(self, ctx): if ctx.guild is not None: 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) 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.guilds(discord.Object(822157545622863902)) @app_commands.describe(sticker="Стикер")