From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.5] (unknown [101.128.125.100]) by gnuweeb.org (Postfix) with ESMTPSA id 13E66804D1; Sat, 3 Sep 2022 10:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1662201833; bh=555syfIRdbO9voeEx/c/84EUXmh+xkDgP53BS4bxlFs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=trCwVP7yr5G/MoP7G/oJJYKk2XVpukZjd0255fc/4idf7lVb05wer3qbzJ7I4Ljj0 3M/2IhlE0GG9mDsJHyGaV31+JK8K08NkHR/3/01oFJ1TGBndj9Tz2+l2m6fY3hpes+ RNyMw19P1SL/pPnDxp9I0HZd9eTGpatlRAdWQ9x9Dvm7GuZxiE1yzB7xuO38zILI0A frviZNYxIeWEjH3FV2/ppjG9CIbW2ZV8dgCX5B329LpnMXx+kil5/IetKfIjxhupXU fgqkkIKQdPFFihjTtNq0A26JPo0bUmdcD6vdn2NE9EfJ9pbL//cGOv5245ajL65smH fruEbOczdeGPA== Message-ID: Date: Sat, 3 Sep 2022 17:43:49 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v2 0/3] New Discord bot and full refactor scripts Content-Language: en-US To: Ammar Faizi Cc: GNU/Weeb Mailing List , Alviro Iskandar Setiawan References: <20220827030236.1094-1-kiizuha@gnuweeb.org> <7a414bd1-68f1-86a4-e647-7ee071a4300d@gnuweeb.org> <4de7a42e-bdae-f3b3-2674-20d673d71a58@gnuweeb.org> <643c97fb-d517-4662-4ce0-6e31a97c9e07@gnuweeb.org> <604e99d6-23fb-8a47-5445-ca10c8655729@gnuweeb.org> <37043daf-bbf9-1ed5-185c-2c223313a0a7@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 03/09/2022 17.32, Ammar Faizi wrote: > 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' > Ugh, my bad, I didn't test this again when I add the `platform` argument and not add the value for it.