matnad/pollmaster

Documentation to set up a private instance

matnad opened this issue · 17 comments

Create a manual on how to set up a private instance of the bot.
If anyone wants to help with this, let me know here or on on discord :)

I would like to move and expand the information on this in the wiki: https://github.com/matnad/pollmaster/wiki
That way it would be easily accessible for new users and I would like to grow the wiki a bit in general.

@matnad Are there any initial steps I can follow to set up pollmaster which I can refer to?
I have installed the requirements and am not sure what I should have in secrets.py.
Presently, these are the steps I have followed
conda create --name pollmaster
conda activate pollmaster
git clone https://github.com/matnad/pollmaster.git
cd pollmaster
conda install pip
~/miniconda3/envs/pollmaster/bin/pip install -r requirements.txt

I am also looking at using a docker container for mongodb:
https://github.com/docker-library/mongo/blob/ebd79727e4e77210272ec55c8b22b17877bfd29a/3.4/Dockerfile

@matnad I saw the discussion on https://discordapp.com/channels/544514197262696469/544543818712875009
Has someone started working on this? I saw one person mentioning working on the documentation.

Your first steps look good!
You can find infos about the secret file here #24.
Zylek started on this issue, but from what I can tell he will write the documentation for Ubuntu without anaconda.
For the future I would like to have all documentation and FAQ in the wiki (https://github.com/matnad/pollmaster/wiki), and there it is also very easy for more than one person to work on a doc.

So if you want to help, that would be much appreciated and you can always hit me up here or on discord.

E: Once a doc is finished, you can still make a pull request to the repo with a markup file so the doc is included with the repo

Thank you @matnad .

I ran mongodb docker using docker run -it -d -p 27017:27017 --name mongodb mongo.

I have specified the following in secrets:
mongo_db = "mongodb://localhost:27017/pollmaster"
bot_token as generated on discord
mode = "development"

I executed pollmaster.py and can see the following:
AsyncIOMotorDatabase(Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=False, driver=DriverInfo(name='Motor', version='2.0.0', platform=None)), 'pollmaster'))
Servers verified. Bot running.

I am unable to figure out my next steps.

good, this looks like the bot is running and connected to discord and the database. Next you need to invite it to your server. There are some instructions on how to do that here: https://discordpy.readthedocs.io/en/latest/discord.html

To figure out what permissions the bot needs, check the invite link for pollmaster which you can find here: https://discordbots.org/bot/444514223075360800

let me know if that works out

@matnad I will try next steps based on the information you have shared.

@matnad Next I created a server, created the invite link https://discordapp.com/api/oauth2/authorize?client_id=client_id&permissions=0&scope=bot&permissions=1073867840
Then I pasted this url in a browser. This gave an option to add a bot to the server I created. I clicked authorize.
I can now see a bot in my discord channel.

this invite link is not working for me, but if the bot is on your server everything should be set up.
Try commands like "pm!help" to see if it is working.

@matnad Yes, it is working. Are there any more steps left to be followed?

Nope! That is it. Everything should be smooth sailing from here.
All that's left is maybe some info like where to find and read the logfile, etc

@matnad There is a log file pollmaster.log in the pollmaster directory. Anything else that needs to be listed?

@matnad
I have the following in the secrets.py file in the essentials directory.
Is this fine?

class SECRETS:
dbl_token = ""
mongo_db = "mongodb://localhost:27017/pollmaster"
bot_token = "bot_token"
mode = "development"

@matnad Can we have a sort of template for the secrets.py file which users can fill in? Or should it be in the documentation itself?

that should be in the documentation itself with a short description of what goes in each field

@matnad I have created a pull request. Please check.