mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Re-enable bridge without spam
This commit is contained in:
parent
7a3b3272f9
commit
9d8c057da6
1 changed files with 23 additions and 30 deletions
|
@ -62,8 +62,9 @@ class Events(commands.Cog):
|
|||
self.bot = bot
|
||||
self.http = httpx.AsyncClient()
|
||||
if not hasattr(self.bot, "bridge_queue") or self.bot.bridge_queue.empty():
|
||||
self.bot.bridge_queue = asyncio.Queue(50)
|
||||
self.bot.bridge_queue = asyncio.Queue()
|
||||
self.fetch_discord_atom_feed.start()
|
||||
self.bridge_health = False
|
||||
|
||||
def cog_unload(self):
|
||||
self.fetch_discord_atom_feed.cancel()
|
||||
|
@ -366,35 +367,27 @@ class Events(commands.Cog):
|
|||
if not message.guild:
|
||||
return
|
||||
|
||||
# if message.channel.name == "femboy-hole" and not message.author.bot:
|
||||
# payload = {
|
||||
# "author": message.author.name,
|
||||
# "content": message.content,
|
||||
# "at": message.created_at.timestamp(),
|
||||
# "attachments": [
|
||||
# {
|
||||
# "url": a.url,
|
||||
# "filename": a.filename,
|
||||
# "size": a.size,
|
||||
# "width": a.width,
|
||||
# "height": a.height,
|
||||
# "content_type": a.content_type,
|
||||
# }
|
||||
# for a in message.attachments
|
||||
# ]
|
||||
# }
|
||||
# if message.author.discriminator != "0":
|
||||
# payload["author"] += '#%s' % message.author.discriminator
|
||||
# try:
|
||||
# self.bot.bridge_queue.put_nowait(payload)
|
||||
# except asyncio.QueueFull:
|
||||
# _m = await message.reply(
|
||||
# "There's over 50 messages waiting to be bridged, slow the fuck down!",
|
||||
# )
|
||||
# print("Queue overload!")
|
||||
# await self.bot.bridge_queue.put(payload)
|
||||
# await _m.delete(delay=0.01)
|
||||
# print("Added %s to queue" % payload)
|
||||
if message.channel.name == "femboy-hole":
|
||||
payload = {
|
||||
"author": message.author.name,
|
||||
"content": message.content,
|
||||
"at": message.created_at.timestamp(),
|
||||
"attachments": [
|
||||
{
|
||||
"url": a.url,
|
||||
"filename": a.filename,
|
||||
"size": a.size,
|
||||
"width": a.width,
|
||||
"height": a.height,
|
||||
"content_type": a.content_type,
|
||||
}
|
||||
for a in message.attachments
|
||||
]
|
||||
}
|
||||
if message.author.discriminator != "0":
|
||||
payload["author"] += '#%s' % message.author.discriminator
|
||||
if message.author != self.bot.user and (payload["content"] or payload["attachments"]):
|
||||
await self.bot.bridge_queue.put(payload)
|
||||
|
||||
if message.channel.name == "pinboard":
|
||||
if message.type == discord.MessageType.pins_add:
|
||||
|
|
Loading…
Reference in a new issue