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: [RFC PATCH v3 09/17] discord: Add success run notice on_ready event
Date: Mon, 19 Sep 2022 14:26:33 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Adding a bot info and success message on the on_ready event.
Signed-off-by: Muhammad Rizki <[email protected]>
---
daemon/dscord/gnuweeb/plugins/__init__.py | 8 ++++++-
.../dscord/gnuweeb/plugins/events/__init__.py | 11 ++++++++++
.../dscord/gnuweeb/plugins/events/on_ready.py | 21 +++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 daemon/dscord/gnuweeb/plugins/events/__init__.py
create mode 100644 daemon/dscord/gnuweeb/plugins/events/on_ready.py
diff --git a/daemon/dscord/gnuweeb/plugins/__init__.py b/daemon/dscord/gnuweeb/plugins/__init__.py
index b9a7e37..ab4cb7f 100644
--- a/daemon/dscord/gnuweeb/plugins/__init__.py
+++ b/daemon/dscord/gnuweeb/plugins/__init__.py
@@ -5,7 +5,13 @@
from discord.ext import commands
+from .events import Events
+
+
+class Plugins(
+ Events
+): pass
async def setup(bot: "commands.Bot"):
- pass
+ await bot.add_cog(Plugins(bot))
diff --git a/daemon/dscord/gnuweeb/plugins/events/__init__.py b/daemon/dscord/gnuweeb/plugins/events/__init__.py
new file mode 100644
index 0000000..d9a891f
--- /dev/null
+++ b/daemon/dscord/gnuweeb/plugins/events/__init__.py
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2022 Muhammad Rizki <[email protected]>
+#
+
+from .on_ready import OnReady
+
+
+class Events(
+ OnReady,
+): pass
diff --git a/daemon/dscord/gnuweeb/plugins/events/on_ready.py b/daemon/dscord/gnuweeb/plugins/events/on_ready.py
new file mode 100644
index 0000000..cb7de29
--- /dev/null
+++ b/daemon/dscord/gnuweeb/plugins/events/on_ready.py
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2022 Muhammad Rizki <[email protected]>
+#
+
+from discord.ext import commands
+
+
+class OnReady(commands.Cog):
+ def __init__(self, bot: "commands.Bot") -> None:
+ self.bot = bot
+
+
+ @commands.Cog.listener()
+ async def on_ready(self):
+ t = "[ GNU/Weeb Bot is connected ]\n\n"
+ t += f"ID : {self.bot.user.id}\n"
+ t += f"Name : {self.bot.user.display_name}\n"
+ t += f"Tags : {self.bot.user}\n\n"
+ t += "Ready to get the latest of lore kernel emails."
+ print(t)
--
Muhammad Rizki
next prev parent reply other threads:[~2022-09-19 7:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 7:26 [RFC PATCH v3 00/17] Refactor Telegram & initial work Discord Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 01/17] telegram: Move the Telegram bot source code Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 02/17] telegram: Refactor Telegram bot database method Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 03/17] telegram: Renaming some functions in scraper/bot.py Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 04/17] Add ignore file for .env Muhammad Rizki
2022-09-20 8:45 ` Ammar Faizi
2022-09-19 7:26 ` [RFC PATCH v3 05/17] telegram: Refactor the Telegram bot Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 06/17] telegram: Renames in telegram mailer directory Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 07/17] Move scraper and utility file Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 08/17] discord: Initial work Discord bot Muhammad Rizki
2022-09-19 7:26 ` Muhammad Rizki [this message]
2022-09-19 7:26 ` [RFC PATCH v3 10/17] discord: Add error handler on events Muhammad Rizki
2022-09-20 8:37 ` Ammar Faizi
2022-09-19 7:26 ` [RFC PATCH v3 11/17] Move db.sql to combine database with Discord and Telegram Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 12/17] discord: Add database tables for Discord bot Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 13/17] discord: Add initial Discord bot database instance Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 14/17] discord: Add save_atom() in database insertion Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 15/17] discord: Add save_broadcast() " Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 16/17] discord: Add save_discord_mail() " Muhammad Rizki
2022-09-19 7:26 ` [RFC PATCH v3 17/17] discord: Add save_email() " Muhammad Rizki
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