Skip to content

An advanced discord bot made with discord.py 2.4.0 Context commands, Views, Modals, Slash commands, Hybrid commands, Group commands, commands, database support, dynamic structure, socket interface, error-handling, logging, ANSI, translator and more.

License

Notifications You must be signed in to change notification settings

PaulMarisOUMary/Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub is maintained CodeQL Deploy Contributors GitHub last commit GitHub last release

Algobot

Table of content

About the project

This discord bot was made for Algosup in 2020. It has a lot of features such translator, events manager, utils, and more. Made by student(s) for students.

Built with

Getting started

Python Prerequisites

Install python packages with:

  • pip
$ pip install -r requirements.txt

Discord developper configuration

  1. Create a application on Discord Developpers

  2. Enable the bot status in Discord Developpers/applications/{YOUR_APP_ID}/bot

  3. Please make sure you have activated each Privileged Gateway Intents in Discord Developpers/applications/{YOUR_APP_ID}/bot #Privileged Gateway Intents for your application.

  4. Copy the token bot from Discord Developpers/applications/{YOUR_APP_ID}/bot #Token

⚠️ In URL replace {YOUR_APP_ID} with your own app/bot ID.

Configure the bot

  1. Paste your dicord bot token in the "token" field inside auth/auth.json.

  2. Configure the prefix in the config\bot.json.

  3. If you're using the database, you need to configure the config\database.json file.

⚠️ If you're NOT using any database, delete the following cogs: fridaycake, me, croissants & birthday.

Workflows

Update and restart discord bot

Github setup:

  • On Github.com go on your project repository
  • Then click on Settings > Actions > Runners > New self-hosted runner.
  • Then select the right runner-image related to your machine and the right architecture.
  • Then follow the Download and the Configure instructions.

Server setup:

  • If you want to start the self-runner on boot, you can follow this guide. :warning: The self-hosted runner should have the following permissions, install apps and start/restart services. (install the service as --user usernameWithPermissions)

Discord bot service: This step is made for linux only.

  • Create a service file in /etc/systemd/system/your-service-name.service with the following content:
[Unit]
Description=Discord bot startup service
After=multi-user.target

[Service]
Type=simple
Restart=no
User={usernameWithPermissions}
WorkingDirectory=/home/{username}/actions-runner/_work/Algosup-Discord/Algosup-Discord
ExecStart=python3 /home/{username}/actions-runner/_work/Algosup-Discord/Algosup-Discord/bot.py

[Install]
WantedBy=multi-user.target

⚠️ Replace {username} & {usernameWithPermissions} with your username and Algosup-Discord/Algosup-Discord with your project name.

  • Then enable the service with systemctl enable your-service-name.service

SQL

SQL tables structure

  • table_birthday
CREATE TABLE IF NOT EXISTS `table_birthday`
(
    `user_id`           BIGINT unsigned NOT NULL,
    `user_birth`        DATE NOT NULL,
UNIQUE(`user_id`)
)
ENGINE = InnoDB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci;
  • table_croissants
CREATE TABLE IF NOT EXISTS `table_croissants`
(
    `user_id`           BIGINT unsigned NOT NULL,
    `user_count`        SMALLINT unsigned,
UNIQUE(`user_id`)
)
ENGINE = InnoDB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci;
  • table_fridaycake
CREATE TABLE IF NOT EXISTS `table_fridaycake`
(
    `user_isin`         BOOLEAN NOT NULL,
    `user_id`           BIGINT unsigned NOT NULL,
    `user_name`         varchar(32) NOT NULL,
UNIQUE(`user_id`)
)
ENGINE = InnoDB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci;
  • table_me
CREATE TABLE IF NOT EXISTS `table_me`
(
    `user_id`           BIGINT unsigned NOT NULL,
    `user_me`           varchar(1024),
UNIQUE(`user_id`)
)
ENGINE = InnoDB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci;
  • table_prefix
CREATE TABLE IF NOT EXISTS `table_prefix`
(
    `guild_id`           BIGINT unsigned NOT NULL,
    `guild_prefix`       varchar(256),
UNIQUE(`guild_id`)
)
ENGINE = InnoDB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci;

Available commands

Show available commands

([smth,smthelse] are aliases)

  • ADMIN:
?changeprefix {new_prefix}
["cp"]



?deletechannel {name}

["delc"]

  

?killloop {cog}

["kill"]

  

?reload {cog}

["rel"]

  

?reloadall

["rell", "relall"]

  

?reloadviews

["rmod", "rview", "rviews"]
  • BASIC:
?help

["h", "?", "commands"]

  

?ping

[]
  • BIRTHDAY:
?birthday

["bd", "setbirthday", "setbirth", "birth"]

  

?showbirthday

['showbirth', 'sbd']
  • FRIDAYCAKE:
?fridaycake

["fc"]

  

?all

["a", "fa"]

  

?next

["n", "nc"]

  

?when

["w", "fw"]
  • INFO:
?emojilist

["ce", "el"]

?lookup {user}

["lk"]

?profilepicture

["pp"]

?stat

['status','graph','gs','sg']
  • ME:
?description

["me"]

  

?showdescription

["sme", "showme"]
  • PRIVATETEXTUAL:
?createprivate

["create", "+"]

  

?deleteprivate

["delete", "-"]

  

?renameprivate

["rename", "_"]

  

?addprivate

["add", ">"]
  • SPOTIFY:
?spotify {user}

["sp", "sy", "spy", "spot"]
  • USEFULL:
?strawpoll

["stp", "straw", "sondage"]

Images:

Show images/icons

Algosup (students)

ALPHA

  • Promotion Alpha 2020-2021 : Aurélien Brendon Clément Clémentine Eloi Eric Florent Ivan Jules Karine Laura-Lee Laurent Louis Martin Max Paul Robin Romain Salahedine Steevy Théo

BETA

  • Promotion Beta 2021-2022 : Alexandre Antonin Arthur David Elise Gaël Guillaume Léo Mathieu Maxime Nicolas Paul Pierre Quentin Robin Théo Thomas

GAMMA

  • Promotion Gamma 2022-2023 :

DELTA

  • Promotion Delta 2023-2024 :

EPSILON

  • Promotion Epsilon 2024-2025 :

ZETA

  • Promotion Zeta 2025-2026 :

ETA

  • Promotion Eta 2026-2027 :

THETA

  • Promotion Theta 2027-2028 :

IOTA

  • Promotion Iota 2028-2029 :

KAPPA

  • Promotion Kappa 2029-2030 :

LAMBDA

  • Promotion Lambda 2030-2031 :

MU

  • Promotion Mu 2031-2032 :

NU

  • Promotion Nu 2032-2033 :

XI

  • Promotion Xi 2033-2034 :

OMICRON

  • Promotion Omicron 2034-2035 :

PI

  • Promotion Pi 2035-2036 :

RHO

  • Promotion Rho 2036-2037 :

SIGMA

  • Promotion Sigma 2037-2038 :

TAU

  • Promotion Tau 2038-2039 :

UPSILON

  • Promotion Upsilon 2039-2040 :

PHI

  • Promotion Phi 2040-2041 :

CHI

  • Promotion Chi 2041-2042 :

PSI

  • Promotion Psi 2042-2043 :

OMEGA

  • Promotion Omega 2043-2044 :

Algosup (sample)

Discord bot logo (sample)

Contributors :

About

An advanced discord bot made with discord.py 2.4.0 Context commands, Views, Modals, Slash commands, Hybrid commands, Group commands, commands, database support, dynamic structure, socket interface, error-handling, logging, ANSI, translator and more.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages