- Description
- Commands
- Commands Usage
- Setup
- Troubleshooting (Linux)
- Troubleshooting (Windows 10)
- Contact
Moji is a self hosting Discord bot which tracks custom emojis usage. It can track both non-animated and animated emojis from messages and reaction messages.
Prefix: !
-
!emotes
Displays all of the server emojis name and its count sorted in descending order. If there are emojis with duplicate counts, then the emojis name is used to sort it.
sudo apt-get update
sudo apt-get install python3.6
python3 -m pip install -U discord.py
python3 -m pip install pymongo
First two steps are only required if you do not have ≥python 3.6 installed
You don't have to get python 3.6, but any version you install must be 3.6 or higher. If you get python 3.7, then it would be
sudo apt-get install python3.7
Press enter for each command you type
- Download the executable on Python.org
- Download Git on the Git page
Mark sure to tick the
Add Python # to PATH
box for the Python installer
Leave everything default for the Git installer
py -3 -m pip install -U discord.py
python -m pip install pymongo
Press enter for each command you type
Setting up Moji requires yourself to host it.
- Go to MongoDB
- Make an account by clicking either the
Start Free
orTry Free
button - Name your organization and your project as well as selecting your preferred language (Optional)
- Select shared clusters (free version).
- Pick a cloud provider and a region closest to you. This may take a few minutes.
- Click the
CONNECT
button - Click the
Add Your Current IP Address
button and click theAdd IP Address
- Go to
Create a Database User
and create your username and your password. Remember your username and your password as you will need it for step 8. - Click
Choose a connection method
button and chooseConnect using MongoDB Compass
button - Pick your operating system and download Mongodb Compass.
- Copy your connection string and replace
password
with the password you created from step 8. - Open Mongodb Compass and paste your connection string and connect.
- Click the
CREATE DATABASE
button and name your database and collection (Optional)
- Go to Discord Developer Portal.
- Login using your existing Discord account or create one if you don't have one.
- Click the
New Application
button. - Name your
Application
and clickCreate
- On the left panel, click
Bot
and click theAdd Bot
button - On the left panel, click
OAuth2
- Check
bot
underscopes
. - Under
Bot Permissions
, checkManage Emojis
,Send Messages
,Manage Messages
,Use External Emojis
, andAdd Reactions
. - Copy and paste the URL generated under
scopes
, select your guild and clickAuthorize
. Check that your bot is in your guild. It should be offline. - Click
Bot
on the left panel and click either theCopy
button orClick to Reveal Token
to get your bot token.
- Open terminal and type
git clone https://github.com/RyanLuong1/Moji.git
- Change your directory to the bot directory
cd /Moji
and typepip3 install -r requirements.txt
. - In the same directory, create a new file
.env
by typingtouch .env
and opening it through the terminal or through your preferred text editor. It should contain the following:DISCORD_TOKEN= "YOUR_DISCORD_TOKEN" CONNECTION_URL= "YOUR_CONNECTION_STRING"
- Replace
"YOUR_DISCORD_TOKEN"
and"YOUR_CONNECTION_STRING"
with their respective token and connection string - Open
CommandEvents.py
andEmoteCommand.py
and replaceemotes_db
andemotes_collection
with your respective database and collection name. (Only do this if you gave your database and collection a name. Otherwise, a database named "emotes_db" and a collection named "emotes_collection" will be created and shown in MongoDB Compass)
DISCORD_TOKEN
is from step 10 ofDiscord Bot Setup
CONNECTION_URL
is from step 12 ofMongoDB Setup
Your respective database name is from step 13 of
MongoDB Setup
Your respective collection name is from step 13 of
MongoDB Setup
- Go to the bot directory and type
python3 emojibot.py
. Now your emojis are loaded to the database and ready for its count to be collected by Moji as long as it is online.
- Open command prompt and type
cd Downloads
- Type
git clone https://github.com/RyanLuong1/Moji.git
- Type
cd Moji
and typepip install -r requirements.txt
- In the same directory, create a new file
.env
by typingtype nul > .env
and opening through the command prompt or through your preferred text editor. It should contain the following:DISCORD_TOKEN = "YOUR_DISCORD_TOKEN" CONNECTION_URL = "YOUR_CONNECTION_STRING"
- Replace your
"YOUR_DISCORD_TOKEN"
and"YOUR_CONNECTION_STRING"
with their respective token and connection string. - Open
CommandEvents.py
andEmoteCommand.py
and replaceemotes_db
andemotes_collection
with your respective database and collection name. (Only do this if you gave your database and collection a name. Otherwise, a database named "emotes_db" and a collection named "emotes_collection" will be created and shown in MongoDB Compass)
DISCORD_TOKEN
is from step 10 ofDiscord Bot Setup
CONNECTION_URL
is from step 12 ofMongoDB Setup
Your respective database name is from step 13 of
MongoDB Setup
Your respective collection name is from step 13 of
MongoDB Setup
- Go to the bot directory and type
python emojibot.py
. Now your emojis are loaded to the database and ready for its count to be collected by Moji as long as it is online.
TypeError: __new__() got an unexpected keyword argument 'deny_new'
Solution. Discord most likely have updated discord.py. Type python3 -m pip install -U discord.py
TypeError: __init__() got an unexpected keyword argument 'requote'
Solution. Read Rapptz's response. Type pip3 install -U yarl==1.4.2
the dns response does not contain an answer to the question
Make sure the connection string you put in .env is exactly the one you use to connect to MongoDB Compass.
- Discord:
Ryаn#6575