Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added detailed setup instructions to readme. #31

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion discord_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ async def on_message(message):

# User mentions: Forward to TG as specified in lookup dict
for username in self.listening_to["handles"]:

user = message.guild.get_member_named(username)

# Cycle through all user mentions in message
Expand Down
13 changes: 12 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ You can now customize the bot to forward any message mentioning your Discord han
a role you want notifications for. These notifications can be switched on on a per-channel
basis as well.

_Alternatively, to run your own fully customizable version of this bot, follow these steps:_

- Clone this repository.
- [Get a Discord bot token](https://www.writebots.com/discord-bot-token/) at the Discord Developer Portal.
- Set the bot up with the permission to view channels and add [server members intent and message content intent](https://discordpy.readthedocs.io/en/stable/intents.html#member-intent).
- [Get a Telegram bot token.](https://riptutorial.com/telegram-bot/example/25075/create-a-bot-with-the-botfather)
- Enter both bot tokens to the `.env` file as shown in [sample.env](https://github.com/jediswaplabs/discord-alert-bot/blob/main/sample.env). No quotes allowed in the `.env` file.
- Add your Discord server ID to the `.env` file under `DEFAULT_GUILD`.
- Add the bot to your Discord server as shown [here](https://www.writebots.com/discord-bot-token/) or set up an [invite link](https://discordapi.com/permissions.html#66560).
- Run `main.py`.

## Requirements & Installation

The bot requires python >= 3.7 (3.9 is recommended) and uses the packages listed in `requirements.txt`.
Expand All @@ -32,7 +43,7 @@ pip install -r requirements.txt

## Usage

Enter the Telegram and Discord bot tokens into `.env` to their respective keys, as shown in [sample.env](https://github.com/jediswaplabs/discord-alert-bot/blob/main/sample.env). Likewise, enter the guild id of the guild you want to use it in to the file. This guild has to have _Telegram Alerts_ bot as member.
Enter the Telegram and Discord bot tokens into `.env` to their respective keys, as shown in [sample.env](https://github.com/jediswaplabs/discord-alert-bot/blob/main/sample.env). Likewise, enter the guild id of the guild you want to use it in to the file. This guild has to have _Telegram Alerts_ bot as member. The bot also needs to be added as member to any private channels you want to receive notifications for.

Run `main.py` to start the bot.
```
Expand Down