Compare commits
No commits in common. "main" and "v0.1" have entirely different histories.
40
README.md
40
README.md
|
@ -1,37 +1,41 @@
|
|||
# HellMBot
|
||||
|
||||
### Discord bot that will wake your friends up from full mute by putting them through 9 circles of hell 🔥
|
||||
### Discord bot that will wake your friends up from full mute by putting them through 9 circles of hell
|
||||
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/Header.svg)
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/Header.png)
|
||||
|
||||
## 🔗 Links:
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/ORUDO.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://git.orudo.ru/trueold89/HellMBot)
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/GitHub.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://github.com/Trueold89/HellMBot)
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/GitLab.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://gitlab.com/Trueold89/hellmbot)
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/Discord.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://discord.com/oauth2/authorize?client_id=1247176574969577514)
|
||||
## Source code:
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/orudo.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://git.orudo.ru/trueold89/HellMBot)
|
||||
[<img src="https://cdn.orudo.ru/.work/trueold89/git/hellm/github.svg" alt="SVG Image" width="300" height="102" style="padding-right: 10px">](https://github.com/Trueold89/HellMBot)
|
||||
|
||||
***
|
||||
|
||||
## ⁉️ Usage:
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/example.gif)
|
||||
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/faq.svg)
|
||||
***
|
||||
|
||||
## Usage:
|
||||
|
||||
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/faq.png)
|
||||
|
||||
---
|
||||
|
||||
- **Add bot to your server**
|
||||
- **Update the bot's permissions to prevent unnecessary people from using its commands (optional)**
|
||||
- **Type /create in any text chat you want**
|
||||
- **Write `/create` in whatever text chat you want**
|
||||
- **Move any user (or yourself, if you're a masochist) to any of the channels in the group created by bot**
|
||||
- **Have fun!**
|
||||
|
||||
## 📦 Deploy:
|
||||
## Deploy:
|
||||
|
||||
***
|
||||
|
||||
### Python venv:
|
||||
|
||||
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/python.svg)
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/python.png)
|
||||
|
||||
- **Install python package from [git.orudo.ru](https://git.orudo.ru/trueold89/HellMBot/packages)**:
|
||||
```shell
|
||||
|
@ -79,7 +83,7 @@ heelm
|
|||
|
||||
### Docker:
|
||||
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/docker.svg)
|
||||
![](https://cdn.orudo.ru/.work/trueold89/git/hellm/docker.png)
|
||||
|
||||
- **Pull image from [git.orudo.ru](https://git.orudo.ru/trueold89/HellMBot/packages)**:
|
||||
```shell
|
||||
|
@ -124,7 +128,7 @@ docker run \
|
|||
|
||||
```yml
|
||||
services:
|
||||
hellm_bot:
|
||||
qbitdl_bot:
|
||||
image: git.orudo.ru/trueold89/hellmbot:latest
|
||||
container_name: HellMBot
|
||||
volumes:
|
||||
|
@ -133,8 +137,6 @@ services:
|
|||
environment:
|
||||
BOT_TOKEN: "insertyourbottokenhere"
|
||||
CLIENT_ID: "insertyourclientidhere"
|
||||
volumes:
|
||||
hellm_db:
|
||||
```
|
||||
|
||||
```shell
|
||||
|
@ -143,7 +145,7 @@ docker compose up -d
|
|||
|
||||
***
|
||||
|
||||
## 📋 Available system environment variables
|
||||
## Available system environment variables
|
||||
|
||||
***
|
||||
|
||||
|
@ -151,9 +153,3 @@ docker compose up -d
|
|||
- `CLIENT_ID` - **Discord Application ID** *[(How to get)](https://docs.discordadvertising.com/getting-your-application-id)*
|
||||
- `DB_PATH` - **Path to SQLite DataBase file** *(Optional | Highly recommended to change when running bot on Windows systems) (Default Value: "/etc/hellmbot/database.sqlite")*
|
||||
- `CIRCLES_COUNT` - **Number of channels the bot creates when the "/create" command is activated.** *(Optional)* *(Default value: 9)*
|
||||
|
||||
## Other:
|
||||
|
||||
**[Design file (Figma Community)](https://www.figma.com/community/file/1380949720890295687/hellm-bot)**
|
||||
|
||||
[![](https://i.imgur.com/SFpy2G2.png)](https://www.figma.com/community/file/1380949720890295687/hellm-bot)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
FROM python:3.12.3-alpine3.19
|
||||
FROM alpine:latest
|
||||
RUN apk update && apk add python3 py3-pip
|
||||
ENV DB_PATH="/etc/hellmbot/database.sqlite"
|
||||
RUN pip install --extra-index-url https://git.orudo.ru/api/packages/trueold89/pypi/simple/ HellMBot
|
||||
RUN pip install --extra-index-url https://git.orudo.ru/api/packages/trueold89/pypi/simple/ HellMBot --break-system-packages
|
||||
WORKDIR /etc/hellmbot
|
||||
ENTRYPOINT ["hellm"]
|
|
@ -1,5 +1,5 @@
|
|||
services:
|
||||
hellm_bot:
|
||||
qbitdl_bot:
|
||||
image: git.orudo.ru/trueold89/hellmbot:latest
|
||||
container_name: HellMBot
|
||||
volumes:
|
||||
|
@ -8,5 +8,3 @@ services:
|
|||
environment:
|
||||
BOT_TOKEN: "insertyourbottokenhere"
|
||||
CLIENT_ID: "insertyourclientidhere"
|
||||
volumes:
|
||||
hellm_db:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from hellmbot.env import ENV
|
||||
from hellmbot.db import ServersDB
|
||||
from discord import Intents, Member, VoiceState, Permissions, errors
|
||||
from discord import Intents, Member, VoiceState, Permissions
|
||||
from discord.utils import oauth_url
|
||||
from discord.ext import commands
|
||||
|
||||
|
@ -39,7 +39,6 @@ async def on_ready() -> None:
|
|||
"""
|
||||
Displays a link to add a bot to the server
|
||||
"""
|
||||
await bot.tree.sync()
|
||||
client_id = ENV.CLIENT_ID.fget(None)
|
||||
invite = oauth_url(client_id, permissions=Permissions(
|
||||
manage_channels=True,
|
||||
|
@ -48,34 +47,7 @@ async def on_ready() -> None:
|
|||
print(f"Your bot invite link: {invite}")
|
||||
|
||||
|
||||
async def clear_channels(db: ServersDB) -> None:
|
||||
"""
|
||||
Clear previously created channels
|
||||
|
||||
:param db: Database
|
||||
"""
|
||||
channels = db.channels
|
||||
for channel in channels:
|
||||
channel = bot.get_channel(channel)
|
||||
await channel.delete()
|
||||
db.clear_channels()
|
||||
|
||||
|
||||
async def create_group(server: commands.Context.guild, db: ServersDB) -> None:
|
||||
"""
|
||||
Creates a group of voice channels to move the user and adds their id to the database
|
||||
|
||||
:param server: Discord server
|
||||
:param db: Database
|
||||
"""
|
||||
circles_count = ENV.CIRCLES_COUNT.fget(None)
|
||||
group = await server.create_category(f"{circles_count} Circles of Hell")
|
||||
for circle in range(circles_count):
|
||||
vc = await server.create_voice_channel(f"{circle + 1} Circle", category=group)
|
||||
db.add_channel(vc.id, circle + 1)
|
||||
|
||||
|
||||
@bot.hybrid_command(name="create", description="Creates a group of vc to move users")
|
||||
@bot.command()
|
||||
async def create(ctx: commands.Context) -> None:
|
||||
"""
|
||||
Creates a group of voice channels to move the user and adds their id to the database
|
||||
|
@ -84,14 +56,13 @@ async def create(ctx: commands.Context) -> None:
|
|||
"""
|
||||
server = ctx.guild
|
||||
db = ServersDB(server.id)
|
||||
await ctx.send("Creating group...", ephemeral=True)
|
||||
try:
|
||||
circles_count = ENV.CIRCLES_COUNT.fget(None)
|
||||
group = await server.create_category(f"{circles_count} Circles of Hell")
|
||||
if db:
|
||||
await clear_channels(db)
|
||||
await create_group(server, db)
|
||||
await ctx.send("Group was created! HF!", ephemeral=True)
|
||||
except errors.Any:
|
||||
await ctx.send("An error occurred!", ephemeral=True)
|
||||
db.clear_channels()
|
||||
for circle in range(circles_count):
|
||||
vc = await server.create_voice_channel(f"{circle + 1} Circle", category=group)
|
||||
db.add_channel(vc.id, circle + 1)
|
||||
|
||||
|
||||
user_before_channels = {}
|
||||
|
|
|
@ -140,7 +140,7 @@ class ServersDB(DataBase):
|
|||
"""
|
||||
Checks the existence of the server in the database table
|
||||
"""
|
||||
lst = self._get(self.TABLE, ["server_id"], {"server_id": self.server})
|
||||
lst = self._get(self.TABLE, ["server_id"])
|
||||
if len(lst) > 0:
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
###################
|
||||
# Actions on user #
|
||||
###################
|
||||
|
||||
class User(object):
|
||||
"""
|
||||
Describes Discord user
|
||||
|
||||
Attributes:
|
||||
- user (int): Discord id
|
||||
"""
|
||||
|
||||
def __init__(self, user_id: int) -> None:
|
||||
"""
|
||||
Init Discord user object
|
||||
|
||||
:param user_id: user discord id
|
||||
"""
|
||||
self.user = user_id
|
||||
|
||||
def move_to(self, channel_id: int) -> None: # ToDo
|
||||
"""
|
||||
Moves the user to the specified voice channel
|
||||
|
||||
:param channel_id: discord id of voice channel
|
||||
"""
|
||||
pass
|
5
setup.py
5
setup.py
|
@ -3,14 +3,15 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name="HellMBot",
|
||||
version="0.2",
|
||||
version="0.1",
|
||||
url="https://git.orudo.ru/trueold89/HellMBot",
|
||||
author="trueold89",
|
||||
author_email="trueold89@orudo.ru",
|
||||
description="Discord bot that will wake your friends up from full mute by putting them through 9 circles of hell",
|
||||
packages=["hellmbot"],
|
||||
long_description=open("README.md").read(),
|
||||
install_requires=["discord.py"],
|
||||
entry_points={
|
||||
"console_scripts": ["hellm = hellmbot.bot:start"]
|
||||
"console_scripts": ["hellm = hellmbot.bot:main"]
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue