Giter Club home page Giter Club logo

invitarr's Introduction

Discord DockerHub Docker Pulls

Invitarr

Invitarr is a chatbot that invites discord users to plex. You can also automate this bot to invite discord users to plex once a certain role is given to a user or the user can also be added manually.

Features

  • Ability to invite users to plex from discord
  • Fully automatic invites using roles
  • Ability to kick users from plex if they leave the discord server or if their role is taken away.
  • Ability to view the database in discord and to edit it.
  • Fully configurable via a web portal

Commands:

.plexinvite <email>
This command is used to add an email to plex
.plexremove <email>
This command is used to remove an email from plex
.dbls
This command is used to list Invitarrs database
.dbadd <email> <@user>
This command is used to add exsisting users email and discord id to the DB.
.dbrm <position>
This command is used to remove a record from the Db. Use -db ls to determine record position. ex: -db rm 1

Unraid Installation

  1. Ensure you have the Community Applications plugin installed.
  2. Inside the Community Applications app store, search for Invitarr.
  3. Click the Install Button.
  4. On the following Add Container screen, add discord bot token.
  5. Click apply
  6. Finish setting up using Setup Commands

Setup

1. Enter discord bot token in bot.env

2. Install requirements

pip3 install -r requirements.txt 

3. Start the bot

python3 Run.py

Docker Setup & Start

  1. First pull the image
docker pull piratify/invitarr:latest
  1. Make the container
docker run -d --restart unless-stopped --name invitarr -v /path to config:/app/app/config -e "token=YOUR_DISCORD_TOKEN_HERE" piratify/invitarr:latest

After bot has started

Setup Commands:

.setupplex
This command is used to setup plex login. 
.roleadd <@role>
These role(s) will be used as the role(s) to automatically invite user to plex
.setuplibs (optional)
This command is used to setup plex libraries. Default is set to all. 

Refer to the Wiki for detailed steps.

Enable Intents else bot will not Dm users after they get the role. https://discordpy.readthedocs.io/en/latest/intents.html#privileged-intents

invitarr's People

Contributors

fabsau avatar faizyy01 avatar headshot-00 avatar ttury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

invitarr's Issues

Error 502 Bad Gateway

Installed in Docker compose, boots to login screen then after using admin:admin it shows me Error: 502 Bad Gateway.

Docker logs show:

[pid: 17|app: 0|req: 1/1] 172.20.0.1 () {50 vars in 3938 bytes} [Wed Jan 20 05:46:12 2021] GET / => generated 237 bytes in 41 msecs (HTTP/1.1 302) 5 headers in 310 bytes (1 switches on core 0)

[pid: 17|app: 0|req: 2/2] 172.20.0.1 () {50 vars in 3959 bytes} [Wed Jan 20 05:46:12 2021] GET /login?next=%2F => generated 4596 bytes in 131 msecs (HTTP/1.1 200) 4 headers in 266 bytes (1 switches on core 0)

172.20.0.1 - - [20/Jan/2021:05:46:12 +0000] "GET /login?next=%2F HTTP/1.1" 200 4596 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.344" "-"

invalid request block size: 4208 (max 4096)...skip

2021/01/20 05:46:16 [error] 14#14: *2 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.20.0.1, server: , request: "POST /login?next=%2F HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.sock:", host: "localhost:5001", referrer: "http://localhost:5001/login?next=%2F"

172.20.0.1 - - [20/Jan/2021:05:46:16 +0000] "POST /login?next=%2F HTTP/1.1" 502 560 "http://localhost:5001/login?next=%2F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.344" "-"

[pid: 17|app: 0|req: 3/3] 172.20.0.1 () {48 vars in 3870 bytes} [Wed Jan 20 05:46:17 2021] GET /favicon.ico => generated 232 bytes in 2 msecs (HTTP/1.1 404) 2 headers in 87 bytes (1 switches on core 0)

172.20.0.1 - - [20/Jan/2021:05:46:17 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "http://localhost:5001/login?next=%2F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.344" "-"```

No module named 'discord'

Add bot token to bot.env, installed requirements and getting this when trying to run run.py

If I rerun the requirements.txt it says Requirement already satisfied on everything.

C:\Program Files\Invitarr Discord Bot>"C:\Program Files\Invitarr Discord Bot\run.py"
Traceback (most recent call last):
File "C:\Program Files\Invitarr Discord Bot\run.py", line 1, in
import discord
ModuleNotFoundError: No module named 'discord'

please add slash command

soon enough discord is going to require these and you dont want the bot to be out of date and no longer work

The bot seem to have a problem !

Hi here is the output:
(Invitarr) discord@saigonoo-server:~/Invitarr$ python3 run.py

V 1.0
/home/discord/Invitarr/run.py:110: RuntimeWarning: coroutine 'BotBase.load_extension' was never awaited
  bot.load_extension(f'app.bot.cogs.app')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2022-08-30 21:03:52 WARNING  discord.ext.commands.bot Privileged message content intent is missing, commands may not work as expected.
2022-08-30 21:03:52 INFO     discord.client logging in using static token
2022-08-30 21:03:54 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: a020e8cde4f385d64cbab001beb099d0).
bot is online.

I did first a git clone , after a pip3 install -r requirments.txt and after a running i get error even if the bot is connected
image
image

Image for armv7

Hello,
is it possible to build your docker image for armv7 please ?

Rgds
Jon

Bot Grammar and Appearance

Some of the basic responses include some grammatical errors. Such as:

Welcome To RidgeServer. Just reply with your email so we can add you to Plex!
to
Welcome to RidgeServer. Just reply with your email so we can add you to Plex!

I will wait 24 hours for your message, if you do not send it by then I will cancel the command.
to
I will wait 24 hours for your message - if you do not send it by then I will cancel the command.

Got it we will be adding your email to plex shortly!
to
Got it! We will be adding your email to Plex shortly!

There was an error adding this email address. Message Server Admin.
to
There was an error adding this email address. Message the Server Admin.

You have Been Added To Plex! Login to plex and accept the invite!
to
You have been added to Plex! Login to Plex and accept the invite!

I also would like to ask if it is ok to remove the embedded messages since I don't think it is necessary if the bot is DMing a user.

discord rank

When i remove the user discord rank it doesn't remove them from the database or plex it gives "Cannot remove this user from plex."

the user did accept the invite i sent him

but .plexremove works

Database file error

Hello,

I was trying to run the docker but i'm getting the following error:
image

Any ideas on what my be causing this issue?

Help adding web user

If I'm being honest, I have no clue what to do. I have installed the docker image and have it running, but cant seem to figure out how to do anything else. Sorry that I made an issue request, but I don't know of any other way to get help or contact you.

Bot dont work (DB and Adding)

Hey i tried to get the Bot to work but i seems like its broken or smth like that,

When i try to add someone to my db the db cant been open after adding it
image

And When i try to add someone to Plex i get this:
image

I cant find the log file and idk what to do

Authentication with 2fa not possible

Hi

I have seen issues #12 #41 #42 , however, this is still not fixed.
Im unable to log in when 2FA is enabled, even if I enter the password as <2fa token> - I can only get the bot to connect with 2fa disabled

Docker container

Is there no way to make the bot read from a *.cfg file placed in the config directory mounted to the container?
Would make it a lot easier to modify things. Either that or allow first time setup to be done through the web interface, similar to Sonarr and Radarr.
If security concerns you with that, I'd say nobody should be exposing this service to the internet before having fully set it up.

I also can't seem to initiate a shell session into the container through Portainer. This only seems to be an issue with Invitarr.

Discord bot not DM'ing users

Hi,

The bot is not dm'ing users, but I can add them manually through the bot's channel. So when the role is assigned, nothing happens, same with removing the role...

Log channel?

will it be possible to readd a log channel in setup commands? like in the version before?
Thanks

Web portal ?

Hello,

what do you mean with webportal ?
(I'm using Docker setup)

Add to DB using Plex user name rather than email

Some of my users have signed up for Plex using a user name rather than with their email address. Can we add an option to use a Plex user name instead of email while using the .dbadd command?

Cant get it to work on Docker mac

Is there a way to get it to work on Mac? I've tried doing the docker installation but keep getting:
Unable to find image 'to:latest' locally

is there a way to fix?

⚠️ Container Port Changed to 80! ⚠️

If the bot is not working after updating to the lastest release, please update port binding.

docker run -d --restart unless-stopped --name invitarr -v /path to config:/app/app/config -p 80:80 piratify/invitarr:latest

FR: Multiple discord servers

Currently (due to only allowing a single channel/role ID) it is not possible to add this bot to multiple servers.
Just wondering if there was a way to add this in?

Option to set "plex_libs" to all

Hello there
the bot seems to be working after you find out that the documentation is a bit outdated. Check the PR.

I would welcome an option to invite users to all libraries available and also an option to turn plex sync on or off.

Thank you very much in advance and have a nice xmas

Kind Regards

Syntax error on password while setting up plex

i get this error when i try to register a password:

Ignoring exception in command setupplex:
today at 21:33:43Traceback (most recent call last):
today at 21:33:43  File "/app/app/bot/helper/confighelper.py", line 84, in change_config
today at 21:33:43    config.set(BOT_SECTION, key, str(value))
today at 21:33:43  File "/usr/local/lib/python3.9/configparser.py", line 1201, in set
today at 21:33:43    super().set(section, option, value)
today at 21:33:43  File "/usr/local/lib/python3.9/configparser.py", line 894, in set
today at 21:33:43    value = self._interpolation.before_set(self, section, option,
today at 21:33:43  File "/usr/local/lib/python3.9/configparser.py", line 402, in before_set
today at 21:33:43    raise ValueError("invalid interpolation syntax in %r at "
today at 21:33:43ValueError: invalid interpolation syntax in '4;!W%6*~u^X&|KZyDwl' at position 4
today at 21:33:43
today at 21:33:43During handling of the above exception, another exception occurred:
today at 21:33:43
today at 21:33:43Traceback (most recent call last):
today at 21:33:43  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
today at 21:33:43    ret = await coro(*args, **kwargs)
today at 21:33:43  File "/app/run.py", line 88, in setupplex
today at 21:33:43    confighelper.change_config("plex_pass", str(password))
today at 21:33:43  File "/app/app/bot/helper/confighelper.py", line 86, in change_config
today at 21:33:43    config.add_section(BOT_SECTION)
today at 21:33:43  File "/usr/local/lib/python3.9/configparser.py", line 1208, in add_section
today at 21:33:43    super().add_section(section)
today at 21:33:43  File "/usr/local/lib/python3.9/configparser.py", line 659, in add_section
today at 21:33:43    raise DuplicateSectionError(section)
today at 21:33:43configparser.DuplicateSectionError: Section 'bot_envs' already exists
today at 21:33:43
today at 21:33:43The above exception was the direct cause of the following exception:
today at 21:33:43
today at 21:33:43Traceback (most recent call last):
today at 21:33:43  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
today at 21:33:43    await ctx.command.invoke(ctx)
today at 21:33:43  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
today at 21:33:43    await injected(*ctx.args, **ctx.kwargs)
today at 21:33:43  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
today at 21:33:43    raise CommandInvokeError(exc) from exc
today at 21:33:43discord.ext.commands.errors.CommandInvokeError: Command raised an exception: DuplicateSectionError: Section 'bot_envs' already exists

is there a possible fix?

thanks

verifyemail

The verifyemail is not working on mobile.
Its still saying, that the email is invalid

Bot still asking for username + password

I saw in the commits that the bot is supposed to ask for Plex Token and URL now, but I have not seen this on my docker install on Unraid. It is still asking me for user and password.

Is this change not on the main branch?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.