Skip to content

Commit

Permalink
chore: Update bot to v5.0.1 (#35)
Browse files Browse the repository at this point in the history
* chore: Author name B1ue-Dev

* perf: check __name__ == "__main__"

* chore: Update const.py

* feat: Remove hornycard and simpcard command

* fix: Startup message

* feat: Remove Flask server (as for now)

* chore: Update requirements.txt

* chore: Update README.md

* chore: Update Dockerfile

* chore: Update poetry.lock

* chore: Update pyproject.toml

---------

Signed-off-by: Blue <60958064+B1ue-Dev@users.noreply.github.com>
  • Loading branch information
B1ue-Dev authored May 7, 2023
1 parent 467e615 commit d1d7690
Show file tree
Hide file tree
Showing 12 changed files with 1,413 additions and 1,367 deletions.
22 changes: 18 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
FROM python:3.10.10

COPY requirements.txt /
RUN python3 -m pip install -r requirements.txt
# we want stdout
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

COPY . /app
# add the path to pythonpath
ENV PYTHONPATH "${PYTHONPATH}:/app"

# install uvloop for faster asyncio
RUN pip3.10 install uvloop

# install the requirements
COPY ./requirements.txt /app/requirements.txt
RUN pip3.10 install -r /app/requirements.txt

# copy over the source files
COPY ./ /app/

# start the bot
WORKDIR /app
ENTRYPOINT ["python3", "bot.py"]
CMD ["python3.10", "bot.py"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

Copyright (C) 2022 Jimmy-Blue
Copyright (C) 2022-2023 B1ue-Dev

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Articuno [![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/c1yv.svg)](https://betteruptime.com/?utm_source=status_badge) [![wakatime](https://wakatime.com/badge/user/4a61584b-76a5-4b28-9ec2-4ebad12be49f/project/c8e18506-9fbe-440b-955f-34219e1ecf5f.svg)](https://wakatime.com/badge/github/Jimmy-Blue/Articuno)
# Articuno [![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/c1yv.svg)](https://betteruptime.com/?utm_source=status_badge) [![wakatime](https://wakatime.com/badge/user/4a61584b-76a5-4b28-9ec2-4ebad12be49f/project/c8e18506-9fbe-440b-955f-34219e1ecf5f.svg)](https://wakatime.com/badge/github/B1ue-Dev/Articuno)
A fun Discord Bot, written with interactions.py.

![banner.png](./articuno_banner.png)
Expand All @@ -8,21 +8,25 @@ A fun Discord Bot, written with interactions.py.

# Feature

Articuno is a multi-purpose Discord Bot that can do a wide variety of jobs, mostly with fun commands. It has a tag system (text) allows you to store and send multiple tags that suit with your server. Featuring an emoji management system, where you can steal and add emojis from other servers (Nitro or image url), remove and look up for the information about an emoji in your server. There is an image search command (powered by Google Images) allows you to look up for different images. Articuno also has a TTS command allows you to have a sentence spoken by different actors from Uberduck. Beside as a fun bot, Articuno also contains a moderation system with logging and a wide variety of msic commands to enhance your server experience.
Articuno is a multi-purpose Discord Bot that can do a wide variety of jobs, mostly with fun commands. It has a tag system (text) allows you to store and send multiple tags that suit with your server. Featuring an emoji management system, where you can steal and add emojis from other servers (Nitro or image url), remove and look up for the information about an emoji in your server. There is an image search command (powered by Google Images) allows you to look up for different images. Articuno also has a TTS command allows you to have a sentence spoken by different actors from Uberduck. And, Articuno also does its job as a Pokemon named bot, by having a **must-have** ``/pokedex`` command and the famous game from the franchise, Who's that Pokemon. Beside as a fun bot, Articuno also contains a moderation system with logging and a wide variety of misc commands to enhance your server experience.

## Highlight commands:

- ``/img``: Look up for images from Google Images.

- ``/tag``: A message tag system (view, create, edit, info, delete, list).
- ``/tag``: A message tag system (view, create, edit, info, delete, list). 📜

- ``/emoji``: An emoji management system (info, steal, add, remove).
- ``/emoji``: An emoji management system (info, steal, add, remove). Those emojis from another look fancy, right? Add them to your own server with Articuno. 🏡

- ``/tts``: Get the message spoken by a character.
- ``/tts``: Get the message spoken by a character. Having a character speaking your sentence must be fun. 😎

- ``/mod``: Moderation commands (kick, ban, hackban, unban, timeout, untimeout).
- ``/mod``: Moderation commands (kick, ban, hackban, unban, timeout, untimeout). You want to keep your server clean and tidy with good members, right? 👮‍♂️

- ``/snipe``: Want to see the most recent deleted message in the chat? /snipe
- ``/snipe``: Want to see the most recent deleted message in the chat? Articuno has you covered, *but in 2 minutes, he can't remember a lot*. 🤒

- ``/trivia``: A trivia game. See how much you know about this world. 🌐

- ``/truth_dare``: You all know the Truth n Dare game that you usually play with your friend group? Looking no more, as Articuno now simulate it on Discord. 👨‍👨‍👧‍👦

## Built in message log system and join/leave
Articuno has a built in log system for deleted message, user join/remove.
Expand All @@ -32,7 +36,7 @@ Articuno has a built in log system for deleted message, user join/remove.
- For join/leave message: Channel with the name ``welcome-goodbye``. This will send an embed message whenever there is a new user who just recently joined the server or someone who just leave the server.

## Misc commands
Articuno has a good range of miscellaneous commands, such as ``amogus``, ``gay``, ``flip``, ``simpcard``, ``hug``, ``ship``, etc. You can have a look more at the bot command list after adding Articuno to your server.
Articuno has a good range of miscellaneous commands, such as ``amogus``, ``flip``, ``hug``, ``ship``, etc. You can have a look more at the bot command list after adding Articuno to your server.

## For Pokemon

Expand All @@ -44,6 +48,16 @@ Articuno has a good range of miscellaneous commands, such as ``amogus``, ``gay``

- ``$shiny <pokemon_name>`` Send a shiny sprite of a Pokemon.

# How to use Articuno

It is very simple. Just add him to your server, select a command from the Articuno list after typing the `/` symbol, read the command description and you are good to go.

Oh, and beside slash command, Articuno also has some commands that have prefixed message command support. (You may wonder what is a prefixed message command? Remember the old time when slash command wasn't a thing yet? You use bots with symbol and name like `$`, `.`, `h!`, `?`.)

Type `/help` to see a list of available slash commands.

Type `$help` to see a list of available prefixed message commands.

# Contribution
Contribution is welcomed. However, we require you to follow our set of rules:
- Follow the repository schema. (Breaking it will result in your Pull Request get closed)
Expand Down
111 changes: 61 additions & 50 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,72 @@
import datetime
import interactions
from interactions.ext.prefixed_commands import setup, PrefixedHelpCommand
from keep_alive import keep_alive
from const import TOKEN, VERSION

client = interactions.Client(
activity=interactions.Activity(
name=f"for {VERSION}",
type=interactions.ActivityType.WATCHING,
),
basic_logging=True,
intents=interactions.Intents.DEFAULT
| interactions.Intents.MESSAGE_CONTENT
| interactions.Intents.GUILD_MEMBERS,
status=interactions.Status.ONLINE,
send_command_tracebacks=False,
)

setup(client, default_prefix="$")
PrefixedHelpCommand(
client,
show_usage=True,
embed_color=0x7CB7D3,
not_found_message="Command `{cmd_name}` not found.",
).register()
client.load_extension("exts.core.__init__")
client.load_extension("exts.fun.__init__")
client.load_extension("exts.server.__init__")
client.load_extension("exts.utils.__init__")
client.load_extension("utils.error")
if __name__ == "__main__":


@client.listen(interactions.events.Startup)
async def on_startup() -> None:
"""Fires up READY"""
websocket = f"{client.latency * 1:.0f}"
log_time = (
datetime.datetime.utcnow() + datetime.timedelta(hours=7)
).strftime("%d/%m/%Y %H:%M:%S")
print(
f"""[{log_time}] Logged in as {client.user.username}. Latency: {websocket}ms."""
client = interactions.Client(
activity=interactions.Activity(
name=f"for {VERSION}",
type=interactions.ActivityType.WATCHING,
),
basic_logging=True,
intents=interactions.Intents.DEFAULT
| interactions.Intents.MESSAGE_CONTENT
| interactions.Intents.GUILD_MEMBERS,
status=interactions.Status.ONLINE,
send_command_tracebacks=False,
)

@client.listen(interactions.events.MessageCreate)
async def on_message_create(_msg: interactions.events.MessageCreate) -> None:
msg = _msg.message
if (
f"@{client.user.id}" in msg.content
or f"<@{client.user.id}>" in msg.content
):
embed = interactions.Embed(
title="It seems like you mentioned me",
description=f"I could not help much but noticed you mentioned me. You can type ``/`` and choose **{client.user.username}** to see a list of available commands.",
color=0x6AA4C1,
)
await msg.channel.send(embeds=embed)
setup(client, default_prefix="$")
PrefixedHelpCommand(
client,
show_usage=True,
embed_color=0x7CB7D3,
not_found_message="Command `{cmd_name}` not found.",
).register()
client.load_extension("exts.core.__init__")
client.load_extension("exts.fun.__init__")
client.load_extension("exts.server.__init__")
client.load_extension("exts.utils.__init__")
client.load_extension("utils.error")


@client.listen(interactions.events.Startup)
async def on_startup() -> None:
"""Fires up READY"""
websocket = f"{client.latency * 1:.0f}"
log_time = (
datetime.datetime.utcnow() + datetime.timedelta(hours=7)
).strftime("%d/%m/%Y %H:%M:%S")
print("".join(
[
f"""[{log_time}] Logged in as {client.user.username}.""",
f"""Latency: {websocket}ms.""",
],
))

@client.listen(interactions.events.MessageCreate)
async def bot_mentions(_msg: interactions.events.MessageCreate) -> None:
"""Check for bot mentions."""
msg = _msg.message
if (
f"@{client.user.id}" in msg.content
or f"<@{client.user.id}>" in msg.content
):
embed = interactions.Embed(
title="It seems like you mentioned me",
description="".join(
[
f"I could not help much but noticed you mentioned me.",
f"You can type ``/`` and choose **{client.user.username}**",
f"to see a list of available commands.",
],
),
color=0x6AA4C1,
)
await msg.channel.send(embeds=embed)


keep_alive()
client.start(TOKEN)
client.start(TOKEN)
4 changes: 2 additions & 2 deletions const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
For value data.
(C) 2022 - Jimmy-Blue
(C) 2022 - B1ue-Dev
"""

import os
Expand All @@ -12,7 +12,7 @@
TOKEN = os.getenv("TOKEN")
"""The token of the bot."""

VERSION = "v5.0.0a"
VERSION = "v5.0.1"
"""Bot version."""

LOG_CHANNEL = os.getenv("LOG_CHANNEL")
Expand Down
4 changes: 2 additions & 2 deletions exts/core/author.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def about(self, ctx: interactions.InteractionContext) -> None:
interactions.Button(
style=interactions.ButtonStyle.LINK,
label="GitHub",
url="https://github.com/Jimmy-Blue/Articuno",
url="https://github.com/B1ue-Dev/Articuno",
),
interactions.Button(
style=interactions.ButtonStyle.LINK,
Expand Down Expand Up @@ -68,7 +68,7 @@ async def _about(self, ctx: PrefixedContext) -> None:
interactions.Button(
style=interactions.ButtonStyle.LINK,
label="GitHub",
url="https://github.com/Jimmy-Blue/Articuno",
url="https://github.com/B1ue-Dev/Articuno",
),
interactions.Button(
style=interactions.ButtonStyle.LINK,
Expand Down
4 changes: 2 additions & 2 deletions exts/core/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def stats(self, ctx: interactions.InteractionContext) -> None:
interactions.Button(
style=interactions.ButtonStyle.LINK,
label="GitHub",
url="https://github.com/Jimmy-Blue/Articuno",
url="https://github.com/B1ue-Dev/Articuno",
),
interactions.Button(
style=interactions.ButtonStyle.LINK,
Expand Down Expand Up @@ -135,7 +135,7 @@ async def _stats(self, ctx: PrefixedContext) -> None:
interactions.Button(
style=interactions.ButtonStyle.LINK,
label="GitHub",
url="https://github.com/Jimmy-Blue/Articuno",
url="https://github.com/B1ue-Dev/Articuno",
),
interactions.Button(
style=interactions.ButtonStyle.LINK,
Expand Down
Loading

0 comments on commit d1d7690

Please sign in to comment.