From: Muhammad Rizki <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH v2 15/28] discord: Add a FullMessageBtn() class in models
Date: Tue, 4 Oct 2022 06:52:16 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Add a FullMessageBtn() class to be able to render a button of a lore
email message on its footer. This class is a clickable URL to direct to
its lore email message.
Signed-off-by: Muhammad Rizki <[email protected]>
---
daemon/dscord/gnuweeb/client.py | 4 ++++
daemon/dscord/gnuweeb/models/__init__.py | 6 ++++++
daemon/dscord/gnuweeb/models/full_message_btn.py | 12 ++++++++++++
3 files changed, 22 insertions(+)
create mode 100644 daemon/dscord/gnuweeb/models/__init__.py
create mode 100644 daemon/dscord/gnuweeb/models/full_message_btn.py
diff --git a/daemon/dscord/gnuweeb/client.py b/daemon/dscord/gnuweeb/client.py
index 7893f88..02a1ac5 100644
--- a/daemon/dscord/gnuweeb/client.py
+++ b/daemon/dscord/gnuweeb/client.py
@@ -7,7 +7,11 @@ import discord
from discord.ext import commands
from discord import Intents
from dscord.config import ACTIVITY_NAME
+from typing import Union
+from . import filters
+from . import models
+from atom import utils
from dscord.database import DB
diff --git a/daemon/dscord/gnuweeb/models/__init__.py b/daemon/dscord/gnuweeb/models/__init__.py
new file mode 100644
index 0000000..c1d2a56
--- /dev/null
+++ b/daemon/dscord/gnuweeb/models/__init__.py
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2022 Muhammad Rizki <[email protected]>
+#
+
+from .full_message_btn import FullMessageBtn
diff --git a/daemon/dscord/gnuweeb/models/full_message_btn.py b/daemon/dscord/gnuweeb/models/full_message_btn.py
new file mode 100644
index 0000000..b8d81cf
--- /dev/null
+++ b/daemon/dscord/gnuweeb/models/full_message_btn.py
@@ -0,0 +1,12 @@
+from discord import ui
+from discord import ButtonStyle
+
+
+class FullMessageBtn(ui.View):
+ def __init__(self, url: str):
+ super().__init__()
+ self.add_item(ui.Button(
+ label='See the full message',
+ style=ButtonStyle.gray,
+ url=url
+ ))
--
Muhammad Rizki
next prev parent reply other threads:[~2022-10-03 23:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 23:52 [PATCH v2 00/28] The complete version of the Discord bot Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 01/28] discord: Add .gitignore in the Discord's storage directory Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 02/28] Fix the storage management after the refactor was happened Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 03/28] Fix the empty temporary patch directory on atom/utils.py Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 04/28] discord: Add get_atom_urls() to get the list of atom URLs Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 05/28] discord: Add get_broadcast_chats() to get the list of broadcast chats Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 06/28] discord: Add get_email_id() in getter directory Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 07/28] discord: Add get_reply_id() " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 08/28] discord: Inherit Getter() class to the DBMethods() class Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 09/28] discord: Add delete_atom() in deletion directory Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 10/28] discord: Add delete_broadcast() " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 11/28] discord: Inherit the Deletion() class to the DBMethods() class Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 12/28] discord: Inherit the DBMethods() class to the DB() class Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 13/28] discord: Use the created " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 14/28] telegram: Rename some utility functions Muhammad Rizki
2022-10-03 23:52 ` Muhammad Rizki [this message]
2022-10-03 23:52 ` [PATCH v2 16/28] discord: Add filters.wait_on_limit() decorator Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 17/28] discord: Add send lore email message functions Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 18/28] discord: Add mail listener Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 19/28] discord: Implement the mail Listener() class Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 20/28] discord: Add @filters.lore_admin() decorator Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 21/28] discord: Add a list of atom URL slash command Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 22/28] discord: Add an add atom " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 23/28] discord: Add a delete " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 24/28] discord: Add channel_link() in the atom/utils.py Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 25/28] discord: Add a list broadcast slash command Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 26/28] discord: Add an add " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 27/28] discord: Add a delete " Muhammad Rizki
2022-10-03 23:52 ` [PATCH v2 28/28] discord: Change the on_ready message Muhammad Rizki
2022-10-07 22:57 ` [PATCH v2 00/28] The complete version of the Discord bot 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