Skip to content

Commit

Permalink
update the requirements and change some stuff inside the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bemxio committed Nov 26, 2024
1 parent 7ae887f commit cc5339e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ env.bak/
*.log

# Project-specific files
src/assets/
_ignore/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 bemxio
Copyright (c) 2022-2024 bemxio, DocileSphinx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
# polkabot
A Discord bot impersonating users via webhooks, based on their messages, using Markov chains.
A Discord bot impersonating users via webhooks, based on their messages. Originally created for [r/okbuddyhololive](https://www.reddit.com/r/okbuddyhololive)'s Discord server, but it can be used for other servers as well.

Originally created for [r/okbuddyhololive](https://www.reddit.com/r/okbuddyhololive/)'s Discord server, but it can be used for other servers as well.

It uses webhooks to send message to a channel with a custom username and avatar (although, the [BOT] tag is still visible next to the name) & it uses [Markov chains](https://en.wikipedia.org/wiki/Markov_chain) to generate messages.
It uses webhooks to send message to a channel with a custom username and avatar (although, the *[BOT]* tag is still visible next to the name) and it uses [Markov chains](https://en.wikipedia.org/wiki/Markov_chain) to generate messages.

## Running
Before running the bot, make sure you are running Python 3.8 or later.
You can download the latest version of Python from [Python.org](https://www.python.org/downloads/).
You can download the latest version of Python from [Python.org](https://www.python.org/downloads).

The bot also requires the **Message Content Intent**, as well as the **Server Members Intent**.

1. Set up a MongoDB database (use the [installation guides](https://www.mongodb.com/docs/manual/administration/install-community/) for help).
1. Set up a MongoDB database (use the [installation guides](https://www.mongodb.com/docs/manual/administration/install-community) for help).
- You can either install it on your host machine, or use a remote MongoDB server, as long as it's accessible from your
host via a connection URI.
2. Create an application with a bot on [Discord Developer Portal](https://discord.com/developers/applications/), remembering to enable the required intents mentioned above.
2. Create an application with a bot on [Discord Developer Portal](https://discord.com/developers/applications), remembering to enable the required intents mentioned above.
- For instructions on creating the account, see [this guide](https://discordpy.readthedocs.io/en/stable/discord.html). It will help you to create an invite link for the bot as well.
- For enabling intents, see [this guide](https://discordpy.readthedocs.io/en/v1.7.3/intents.html#privileged-intents).
- For enabling intents, see [this guide](https://discordpy.readthedocs.io/en/stable/intents.html#privileged-intents).
3. Clone the repository to your host machine, or download the source code using the `Code > Download ZIP` button.
4. Fill out all the values in the `config.toml` file, according to the comments in the file.
5. Set a permanent system-wide environment variable `DISCORD_TOKEN` with the bot's token, that you can get on the Discord Developer Portal.
- For Windows, you can use [this](https://www.java.com/en/download/help/path.html) for help.
- For Linux, you can put `export DISCORD_TOKEN="<BOT_TOKEN_HERE>"` in the file `~/.bashrc` or `~/.zshrc` (depending on your shell).
- For Windows, you can use [this](https://www.java.com/en/download/help/path.html) as guidance.
- For Linux, you can put `export DISCORD_TOKEN="<BOT_TOKEN_HERE>"` in the file `~/.bashrc` or `~/.zshrc`, depending on your shell.
6. Set a permanent system-wide environment variable `MONGODB_CONNECTION_URI` with the connection URI to a MongoDB database.
7. Open a terminal with the bot files in the current directory.
8. Install the dependencies for the bot using `pip`.
- On Windows, it's: `py -3 -m pip install -r requirements.txt`.
- On Linux, it's: `python3 -m pip install -r requirements.txt`.
- You only need to do this once. You can skip this step if you already have the dependencies installed.
9. Run the bot using `python3 main.py` or `py -3 main.py`, depending on your operating system.
9. Run the bot using `python3 bot.py` or `py -3 bot.py`, depending on your operating system.

## Contributing
If you want to contribute to the project, you can fork the repository on GitHub and make a pull request, if you want to.
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
py-cord~=2.4.1
python-dotenv~=1.0.0
tomli~=2.0.1
py-cord~=2.6.1
python-dotenv~=1.0.1
tomli~=2.1.0
markovify~=0.9.4
motor~=3.2.0
motor~=3.6.0
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash

# update the system
sudo -S apt-get update && sudo apt-get upgrade -y
Expand All @@ -9,7 +9,7 @@ cd ~/project-pretender
# update python packages
python3 -m pip install -r requirements.txt --upgrade

# pull the latest code
# pull the latest code from the repository
git pull origin main

# restart the service
Expand Down

0 comments on commit cc5339e

Please sign in to comment.