8000 GitHub - orel33/ubot: Discord Bot for Authentication @ University of Bordeaux / Licence Informatique
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

orel33/ubot

Repository files navigation

README

This is the public repository for a Discord bot (named ubot) used for account verification against University of Bordeaux IDNum.

Create your Discord server with your own bot

Program your first bot

En NodeJS :

sudo apt install npm
npm init
npm i --save discord.js
export DICORD_TOKEN="<TOKEN>"

Then add a file index.js like that...

const Discord = require('discord.js');
const bot = new Discord.Client();
const token = process.env.DISCORD_TOKEN;
bot.login(token);

Then run it like this:

node index.js

Or like that through a screen session like that:

screen -S discord -d -m node index.js

To launch it on a remote server like tesla over SSH, I recommand a screen session like that:

export DISCORD_TOKEN="<TOKEN>"
export DISCORD_MYID="<MYID>"
screen -S discord -d -m  node index.js
...
# re-attach..
screen -r
# and detach (ctrl-a d)

Server Settings

Check your server has the following settings...

In pratice, you must first create by yourself a channel: #welcome, to welcome all incoming users that are not yet verified...

The following roles are automatically created/updated with the right permissions...

  • a role @student
  • a role @teacher
  • a role @unverified with few permissions (only read/write messages in #welcome)
  • a temporary role @everyone with same permissions as @unverified

Finally, you must check the position of each role : @everyone < @unverified < @student < @teacher < @ubot < @admin and move them if needed.

The account verification is just based on a HTTPS / HTACCESS account registration to map IDNum (UBx account) with Dicord account (or ID). Each new user will automatically receive a private registration message from ubot... but it is also possible to ask this message explicitly with command !register in the channel #welcome.

TODO

  • The bot should configure all channels, roles and permissions automatically... but it will require admin privilege...
  • Use LDAP request in PHP to get user info...

BUGS

  • The Discord username must be 32 or fewer in length.

Documentation

About

Discord Bot for Authentication @ University of Bordeaux / Licence Informatique

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0