diff --git a/discord_bot.py b/discord_bot.py index ea97495..f8e0358 100644 --- a/discord_bot.py +++ b/discord_bot.py @@ -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 diff --git a/readme.md b/readme.md index 90f37b5..d2a3fbf 100644 --- a/readme.md +++ b/readme.md @@ -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`. @@ -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. ```