From: Ammar Faizi <[email protected]>
To: Muhammad Rizki <[email protected]>
Cc: GNU/Weeb Mailing List <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>
Subject: Re: [PATCH v2 0/3] New Discord bot and full refactor scripts
Date: Sat, 3 Sep 2022 17:32:08 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 9/3/22 5:05 PM, Muhammad Rizki wrote:
> On 03/09/2022 16.44, Ammar Faizi wrote:
>> On 9/3/22 8:01 AM, Muhammad Rizki wrote:
>>> The `ADMIN_ROLE_ID` is the Discord role ID for `Lore Admin` to manage
>>> add/delete atom/broadcast. You can copy it from the role management in
>>> Discord, paste the role ID to the ADMIN_ROLE_ID in
>>> daemon/dscord/config.py (the config name must config.py because it will
>>> importable with Python)
>>
>> I did that, it's running and the bot is online as well. But how to use
>> the bot exactly? Any example?
>>
>
> Oh yes, my bad. I develop the script to avoid ratelimit for syncing
> slash commands, so I decide to init it using the [`$sync`, `.sync`,
> `.s`, `$s`] or whatever is, you can find it the basic command in the
> `daemon/dscord/gnuweeb/plugins/basic_commands/sync_it.py` file.
>
> The old one I sync it in the `setup_hook()` in client.py, so when the
> bot is starting, it will initialize/sync the slash commands to global,
> this is not recommended by the community, because while you debugging
> you will restarting the script many times, it will hit the ratelimit, so
> I decide to comment it and initialize using the `.sync` basic commmand.
>
>
> The bot uses slash commands, if you type "/" in the channel text field
> chat, it will display the list of slash commands, for example:
>
> Typing `/atom` it will display the list of group commands for atom
> like add, list or delete.
> Typing `/broadcast` it will display the list of group commands for
> broadcast like add, list or delete.
>
> Still didn't work? tell me.
OK, just did the sync command and now I can see the command suggestions
on the Discord input box. Then I tried to add several atom URLS. At a
glance it works. So I am happy with the current functional.
But it's still not perfect, when invoking `/lore url:` command, I got
the following error and the bot didn't respond:
[__run]: Running...
2022-09-03 17:18:08 ERROR discord.app_commands.tree Ignoring exception in command 'lore'
Traceback (most recent call last):
File "/home/ammarfaizi2/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 850, in _do_call
return await self._callback(self.binding, interaction, **params) # type: ignore
File "/home/ammarfaizi2/app/lore-daemon.dev/daemon/dscord/gnuweeb/plugins/slash_commands/get_lore_mail.py", line 30, in get_lore
text, files, is_patch = utils.create_template(mail)
TypeError: create_template() missing 1 required positional argument: 'platform'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ammarfaizi2/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1240, in _call
await command._invoke_with_namespace(interaction, namespace)
File "/home/ammarfaizi2/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 876, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
File "/home/ammarfaizi2/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 865, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'lore' raised an exception: TypeError: create_template() missing 1 required positional argument: 'platform'
[__run]: Running...
Please fix it in the next revision.
I got other errors when the bot is broadcasting the email to a Discord
channel. Will send that in a separate email.
--
Ammar Faizi
next prev parent reply other threads:[~2022-09-03 10:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 3:02 [PATCH v2 0/3] New Discord bot and full refactor scripts Muhammad Rizki
2022-08-27 3:02 ` [PATCH v2 1/3] Move the Telegram bot source code Muhammad Rizki
2022-08-27 3:02 ` [PATCH v2 2/3] First release Discord bot Muhammad Rizki
2022-09-03 0:29 ` Ammar Faizi
2022-08-27 3:02 ` [PATCH v2 3/3] Full refactor bot scripts Muhammad Rizki
2022-08-27 10:40 ` [PATCH v2 0/3] New Discord bot and full refactor scripts Ammar Faizi
2022-08-27 16:00 ` Muhammad Rizki
2022-08-29 3:39 ` Ammar Faizi
2022-09-03 0:42 ` Ammar Faizi
2022-09-03 0:45 ` Ammar Faizi
2022-09-03 1:01 ` Muhammad Rizki
2022-09-03 9:44 ` Ammar Faizi
2022-09-03 9:46 ` Ammar Faizi
2022-09-03 10:05 ` Muhammad Rizki
2022-09-03 10:32 ` Ammar Faizi [this message]
2022-09-03 10:34 ` Ammar Faizi
2022-09-03 10:40 ` Ammar Faizi
2022-09-03 10:58 ` Muhammad Rizki
2022-09-03 10:52 ` Muhammad Rizki
2022-09-03 10:43 ` Muhammad Rizki
2022-09-03 0:56 ` Muhammad Rizki
2022-09-03 1:00 ` Ammar Faizi
2022-09-03 0:29 ` Ammar Faizi
2022-09-03 1:28 ` Ammar Faizi
2022-09-03 3:09 ` Muhammad Rizki
2022-09-03 9:56 ` Alviro Iskandar Setiawan
2022-09-03 9:58 ` Ammar Faizi
2022-09-03 10:06 ` Alviro Iskandar Setiawan
2022-09-03 10:12 ` Ammar Faizi
2022-09-03 10:43 ` Alviro Iskandar Setiawan
2022-09-03 11:09 ` Ammar Faizi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox