dts-11 / pizzahat Goto Github PK
View Code? Open in Web Editor NEWMulti-purpose bot made with discord.py
Home Page: https://pizzahat.vercel.app
License: GNU Affero General Public License v3.0
Multi-purpose bot made with discord.py
Home Page: https://pizzahat.vercel.app
License: GNU Affero General Public License v3.0
Is your feature request related to a problem? Please describe.
The bot currently uses DiscordTogether for voice channel embedded activities. The same functionality in built-in in pycord. Using another 3rd party library is not needed
Describe the solution you'd like
Use the create_activity_invite
method on a voice channel.
Ex- link = await ctx.author.voice.channel.create_activity_invite(discord.EmbeddedActivity.watch_together)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
I can create a pr if you want
Update custom checks to send custom msg, for example: if the server doesn't have a staff role set, instead of doing nothing (current), make the bot send an error msg -> "Staff role is not set for this server."
And likewise for the user_is_staff
check.
Could be done by using discord.py's error handler
Also need to fix the custom checks, as they are not working as expected. A command should run if u have the staff role set and if the user is staff. But in cogs/admin.py
, those commands won't run. They run when those checks are commented.
The complete error from logging:
ERROR - 2024-01-28 13:45:56,523 - client : Ignoring exception in on_message_edit
Traceback (most recent call last):
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\asyncio\proactor_events.py", line 286, in _loop_reading
length = fut.result()
^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 846, in _poll
value = callback(transferred, key, ov)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 494, in finish_recv
return ov.getresult()
^^^^^^^^^^^^^^
OSError: [WinError 121] The semaphore timeout period has expired
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "D:\Projects\PizzaHat\PizzaHat\utils\events.py", line 105, in on_message_edit
channel = await self.get_logs_channel(before.guild.id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\PizzaHat\PizzaHat\utils\events.py", line 77, in get_logs_channel
data = await self.bot.db.fetchval("SELECT channel_id FROM modlogs WHERE guild_id=$1", guild_id) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\pool.py", line 608, in fetchval
async with self.acquire() as con:
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\pool.py", line 1005, in __aexit__
await self.pool.release(con)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\pool.py", line 879, in release
return await asyncio.shield(ch.release(timeout))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\pool.py", line 220, in release
raise ex
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\pool.py", line 210, in release
await self._con.reset(timeout=budget)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\connection.py", line 1366, in reset
await self.execute(reset_query, timeout=timeout)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncpg\connection.py", line 317, in execute
return await self._protocol.query(query, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "asyncpg\protocol\protocol.pyx", line 338, in query
asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation
Switching from bot.start() to bot.run() required some steps to change the __main__.py
. That caused some DB issues, works, but gives some error msg in the terminal when using the sql
command
ERROR MSG
C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py:80: RuntimeWarning: coroutine 'Pool.fetchval' was never awaited
self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
To Reproduce
Steps to reproduce the behavior:
py .
sql
cmd and tickets cog also seem to cause this issueExpected behavior
Bot should run normal without any errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.