hackthebox / hackster Goto Github PK
View Code? Open in Web Editor NEWHTB official Discord bot
License: MIT License
HTB official Discord bot
License: MIT License
I know that I released https://github.com/HeckerBirb/NoahBot without a license but it would be nice to have a reference to the original repository, which this is still heavily based on, referenced in the "CODEOWNERS" file, or the "README" file.
:)
No response
No response
AttributeError: 'NoneType' object has no attribute 'delete'
File "src/cmds/core/other.py", line 40, in spoiler
await ctx.message.delete()
ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'delete'
(1 additional frame(s) were not displayed)
...
File "src/bot.py", line 85, in on_application_command_error
raise error
Task exception was never retrieved
future: <Task finished name='pycord: on_application_command_error' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=ApplicationCommandInvokeError("Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'delete'")>
AttributeError: 'Channels' object has no attribute 'SR_MODERATOR'
AttributeError: 'Channels' object has no attribute 'SR_MODERATOR'
File "src/cmds/core/ban.py", line 48, in tempban
response = await ban_member(self.bot, ctx.guild, member, duration, reason, ctx.user, needs_approval=True)
File "src/helpers/ban.py", line 135, in ban_member
await guild.get_channel(settings.channels.SR_MODERATOR).send(embed=embed)
ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Channels' object has no attribute 'SR_MODERATOR'
(1 additional frame(s) were not displayed)
...
File "src/bot.py", line 81, in on_application_command_error
raise error
Task exception was never retrieved
future: <Task finished name='pycord: on_application_command_error' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=ApplicationCommandInvokeError("Application Command raised an exception: AttributeError: 'Channels' object has no attribute 'SR_MODERATOR'")>
Update bans requests/logs to show user DisplayName(username)
No response
No response
role for each prolab assigned on completion via verification system
No response
No response
Reduce friction to request/report bugs and feature requests by adding /feature /bug commands into the bot
No response
https://pygithub.readthedocs.io/en/latest/examples/Issue.html#create-issue
when a user leaves and rejoins, mutes are not applied
get muted
leave server
rejoin
Umuted
Get muted
leave server
rejoin
muted
No response
No response
Unmutes failing
Allow /whois to return a users academy ID/username when academy verified
No response
No response
We had intended to add this into the old bot but had never gotten around to it
If these are met, grant the APT role, and inform the user: "You've been designated an APT ๐"
Example error:
We're sorry, but you are not eligible for the APT Role. You have 525/1000 needed messages
We're sorry, but you are not eligible for the APT Role. You joined less then 3 months ago. Retry on {DATE}
We're sorry, but you are not eligible for the APT Role. You have been issued a warning/strike within the last 14 days.
No response
No response
Noah pics have stalled since I cannot ping the Noah Gang role. Sadge.
Requesting ability to ping "Noah Gang". ๐ฅฒ
Cannot ping "Noah Gang".
No response
have /spoiler post a message internally on slack
optimally with button to mark as done/actioned
No response
No response
Sentry Issue: HACKSTER-1E
AttributeError: 'NoneType' object has no attribute 'id'
(1 additional frame(s) were not displayed)
...
File "src/cmds/automation/auto_verify.py", line 66, in on_member_join
await self.process_reverification(member)
File "src/cmds/automation/auto_verify.py", line 46, in process_reverification
await process_identification(htb_details, user=member, bot=self.bot)
File "src/helpers/verification.py", line 106, in process_identification
await ban_member(bot, guild, member, ban_duration, reason, None, needs_approval=False)
File "src/helpers/ban.py", line 34, in ban_member
if author.id == member.id:
Task exception was never retrieved
future: <Task finished name='pycord: on_member_join' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=AttributeError("'NoneType' object has no attribute 'id'")>
And by potential, I do mean potential :) Should use timing safe comparison here
Hackster/src/webhooks/server.py
Line 43 in ff719da
We have the academy SSO feature, users who have linked accounts should also receive the CBBH or CPTS role on passing, as currently this role is given manually.
Alternatively, a /cert-validate that takes the cert-id and & name same as on https://www.hackthebox.com/certificates to assign.
(would probs require acad dev work for the first one)
No response
No response
field next to reason that you can link the screenshot of evidence, stored only in the note made internally
No response
No response
NoResultFound: Mute not found for user ID 708459984735961118
File "src/cmds/core/mute.py", line 83, in unmute
await unmute_member(ctx.guild, member)
File "src/helpers/ban.py", line 222, in unmute_member
raise NoResultFound(f"Mute not found for user ID {member.id}")
ApplicationCommandInvokeError: Application Command raised an exception: NoResultFound: Mute not found for user ID 708459984735961118
(1 additional frame(s) were not displayed)
...
File "src/bot.py", line 85, in on_application_command_error
raise error
Task exception was never retrieved
future: <Task finished name='pycord: on_application_command_error' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=ApplicationCommandInvokeError('Application Command raised an exception: NoResultFound: Mute not found for user ID 708459984735961118')>
Hello to you, I installed hackster on my VPS to make it run on my discord, I have however a problem, I lack many tables for the DB (I created the first ones for the api to launch) do you have a list of Tables or installation sheet?thank you very much
(Background on this error at: https://sqlalche.me/e/20/f405)
15:43:31 - asyncio ERROR: Task exception was never retrieved
future: <Task finished name='pycord: on_message' coro=<Client._run_event() done, defined at /root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/discord/client.py:370> exception=ProgrammingError('(asyncmy.errors.ProgrammingError) (1146, "Table 'bot_dev.htb_discord_link' doesn't exist")')>
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1963, in exec_single_context
self.dialect.do_execute(
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
cursor.execute(statement, parameters)
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/asyncmy.py", line 95, in execute
return self.await(self._execute_async(operation, parameters))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 126, in await_only
return current.driver.switch(awaitable) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 187, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/asyncmy.py", line 107, in _execute_async
result = await self._cursor.execute(operation, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "asyncmy/cursors.pyx", line 179, in execute
File "asyncmy/cursors.pyx", line 364, in _query
File "asyncmy/connection.pyx", line 450, in query
File "asyncmy/connection.pyx", line 638, in _read_query_result
File "asyncmy/connection.pyx", line 1025, in read
File "asyncmy/connection.pyx", line 600, in read_packet
File "asyncmy/protocol.pyx", line 190, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/protocol.pyx", line 194, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/errors.pyx", line 128, in asyncmy.errors.raise_mysql_exception
File "asyncmy/errors.pyx", line 137, in asyncmy.errors.raise_mysql_exception
asyncmy.errors.ProgrammingError: (1146, "Table 'bot_dev.htb_discord_link' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/discord/client.py", line 383, in _run_event
await self.on_error(event_name, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/discord/client.py", line 378, in _run_event
await coro(*args, **kwargs)
File "/hackster/hackster/src/cmds/automation/auto_verify.py", line 57, in on_message
await self.process_reverification(ctx.author)
File "/hackster/hackster/src/cmds/automation/auto_verify.py", line 30, in process_reverification
result = await session.scalars(stmt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/session.py", line 553, in scalars
result = await self.execute(
^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/session.py", line 435, in execute
result = await greenlet_spawn(
^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 192, in greenlet_spawn
result = context.throw(*sys.exc_info())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2232, in execute
return self._execute_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2127, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 292, in orm_execute_statement
result = conn.execute(
^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1413, in execute
return meth(
^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1637, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1982, in _exec_single_context
self._handle_dbapi_exception(
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1963, in exec_single_context
self.dialect.do_execute(
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
cursor.execute(statement, parameters)
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/asyncmy.py", line 95, in execute
return self.await(self._execute_async(operation, parameters))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 126, in await_only
return current.driver.switch(awaitable) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 187, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/asyncmy.py", line 107, in _execute_async
result = await self._cursor.execute(operation, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "asyncmy/cursors.pyx", line 179, in execute
File "asyncmy/cursors.pyx", line 364, in _query
File "asyncmy/connection.pyx", line 450, in query
File "asyncmy/connection.pyx", line 638, in _read_query_result
File "asyncmy/connection.pyx", line 1025, in read
File "asyncmy/connection.pyx", line 600, in read_packet
File "asyncmy/protocol.pyx", line 190, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/protocol.pyx", line 194, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/errors.pyx", line 128, in asyncmy.errors.raise_mysql_exception
File "asyncmy/errors.pyx", line 137, in asyncmy.errors.raise_mysql_exception
sqlalchemy.exc.ProgrammingError: (asyncmy.errors.ProgrammingError) (1146, "Table 'bot_dev.htb_discord_link' doesn't exist")
[SQL: SELECT htb_discord_link.id, htb_discord_link.account_identifier, htb_discord_link.discord_user_id, htb_discord_link.htb_user_id
FROM htb_discord_link
WHERE htb_discord_link.discord_user_id = %s ORDER BY htb_discord_link.id
LIMIT %s]
[parameters: (1048313568199704616, 1)]
(Background on this error at: https://sqlalche.me/e/20/f405)
โโ# poetry run task start
14:51:28 - discord.client WARNING: PyNaCl is not installed, voice will NOT be supported
14:51:28 - main INFO: Starting bot & webhook server
INFO: Started server process [9326]
INFO: Waiting for application startup.
14:51:28 - discord.client INFO: logging in using static token
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:1337 (Press CTRL+C to quit)
14:51:31 - src.bot INFO: Started bot as Hckster#8721 (ID: 1128287330088788000)
Loading ScheduledTasks cog...
ScheduledTasks cog loaded!
14:52:37 - asyncio ERROR: Task exception was never retrieved
future: <Task finished name='pycord: on_application_command' coro=<Client._run_event() done, defined at /root/.cache/pypoetry/virtualenvs/hackster-jqLlKwl8-py3.11/lib/python3.11/site-packages/discord/client.py:370> exception=AttributeError("'NoneType' object has no attribute 'send'")>
No response
.
.
.
When banning a user, or kicking a user it doesnt show in ++history
ban/kick a user
run history on said user
nothing
ban/kick a user
run history on said user
shows ban / kick + reason
No response
No response
After I setup the env variables with export
command, and launching poetry run task start
, I get this error: https://pastebin.com/gjNtv0g8
What did I do wrong? Did I miss something?
Thanks for your time and your help.
No response
No response
Tempban command execution works as per audit log, but it returns Application did not respond
Use the command /tempban user:@Tejas#4422 duration:6Mo reason:Testing
It should output 561210274653274133 has been banned until 2024-08-16 15:13:16 (UTC) and ban the user, also add note for the same.
No response
The /whois
command can take either a Discord or HTB ID and retrieve the corresponding linked account. Because the paramater is typed as a Member
though, the client does not allow entering numbers such as a HTB ID
https://github.com/hackthebox/Hackster/blob/main/src/cmds/core/user.py#L191
So only the Discord -> HTB lookup works
/whois
83743
)I expected that I'd see my Discord account linked
Instead, I saw this error
No response
No response
DataError: (1264, "Out of range value for column 'unban_time' at row 1")
(11 additional frame(s) were not displayed)
...
File "asyncmy/connection.pyx", line 600, in read_packet
File "asyncmy/protocol.pyx", line 190, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/protocol.pyx", line 194, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/errors.pyx", line 128, in asyncmy.errors.raise_mysql_exception
File "asyncmy/errors.pyx", line 137, in asyncmy.errors.raise_mysql_exception
DataError: (asyncmy.errors.DataError) (1264, "Out of range value for column 'unban_time' at row 1")
[SQL: INSERT INTO ban (user_id, reason, moderator_id, unban_time, approved, unbanned, timestamp) VALUES (%s, %s, %s, %s, %s, %s, %s)]
[parameters: ([REDACTED], '[REDACTED]', [REDACTED], 2153337603, 0, 0, None)]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
(38 additional frame(s) were not displayed)
...
File "asyncmy/connection.pyx", line 600, in read_packet
File "asyncmy/protocol.pyx", line 190, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/protocol.pyx", line 194, in asyncmy.protocol.MysqlPacket.raise_for_error
File "asyncmy/errors.pyx", line 128, in asyncmy.errors.raise_mysql_exception
File "asyncmy/errors.pyx", line 137, in asyncmy.errors.raise_mysql_exception
ApplicationCommandInvokeError: Application Command raised an exception: DataError: (asyncmy.errors.DataError) (1264, "Out of range value for column 'unban_time' at row 1")
[SQL: INSERT INTO ban (user_id, reason, moderator_id, unban_time, approved, unbanned, timestamp) VALUES (%s, %s, %s, %s, %s, %s, %s)]
[parameters: ([REDACTED], '[REDACTED]', [REDACTED], 2153337603, 0, 0, None)]
(Background on this error at: https://sqlalche.me/e/20/9h9h)
(1 additional frame(s) were not displayed)
...
File "src/bot.py", line 81, in on_application_command_error
raise error
Task exception was never retrieved
future: <Task finished name='pycord: on_application_command_error' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=ApplicationCommandInvokeError('Application Command raised an exception: DataError: (asyncmy.errors.DataError) (1264, "Out of range value for column \'unban_time\' at row 1")\n[SQL: INSERT INTO ban (user_id, reason, moderator_id, unban_time, approved, unbanned, timestamp) VALUES (%s, %s, %s, %s, %s, %s, %s)]\n[parameters: ([REDACTED], \'[REDACTED]\', [REDACTED], 2153337603, 0, 0, None)]\n(Background on this error at: https://sqlalche.me/e/20/9h9h)')>
Instead of using ID's to approve ban requests, use the buttons built into discord
https://guide.pycord.dev/interactions/ui-components/buttons
No response
No response
Like already partially discussed in the comments of #19 .
The old data (infraction history, notes, etc) are being stored for users that left and this might go against the GDPR laws.
I ain't a lawyer so might be worth looking into.
NotFound: 404 Not Found (error code: 10062): Unknown interaction
(2 additional frame(s) were not displayed)
...
File "src/cmds/core/verify.py", line 76, in verify
return await ctx.respond("Please check your DM for instructions.", ephemeral=True)
ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
(1 additional frame(s) were not displayed)
...
File "src/bot.py", line 85, in on_application_command_error
raise error
Task exception was never retrieved
future: <Task finished name='pycord: on_application_command_error' coro=<Client._run_event() done, defined at /opt/hackster/.venv/lib/python3.11/site-packages/discord/client.py:370> exception=ApplicationCommandInvokeError('Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction')>
Validate against cert validation API to add CBBH/CPTS roles
No response
No response
When trying to add a note/ban users who have left the server, this action fails
User leaves server
try to add note / ban / whois / history
Note gets added / user gets banned & command should accept INT input
Also should be able to run /whois on an HTB ID, or a user who has left the server, which is not possible.
same with history not allowed to be run on left users
No response
No response
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.