A copypasta bot that fetches copypasta... as a Discord message.
Made with ♥ for all the copypasta lovers.
This bot fetches submissions from /r/copypasta and /r/emojipasta and sends them as a message in Discord.
Anyone is welcome to add the bot!
Here is the link to authorize:
https://discord.com/api/oauth2/authorize?client_id=802369923845455933&permissions=280576&scope=bot
It should have the following permissions in the server:
Command Prefixes = pastabot! | pasta! | pb! | p!
Full Commands:
pasta!get [hot|top|new] <count>
Get a singular copypasta that is <count> posts from the top.pasta!list [hot|top|new] <count>
Lists title of the top <count> copypasta posts.pasta!rand [hot|top|new] [<count>]
Get a random copypasta where <count> is the max. (Default is 50)pasta!show <url>
Sends a message with the contents of post body from the URL suppliedShort Commands:
pasta!get
p!gpasta!list
p!lpasta!random
p!rpasta!show
p!sThe script currently needs some API credentials from both Discord and Reddit.
Go to the Discord API portal: https://discord.com/developers/applications
Click "New Application" button on top right, name it anything
In the newly created application, go to the "Bot" tab on the menu on the left
Under "Build A Bot" there will be a token label with a Copy button. Copy that token
Set your environment variable DISCORD_BOT_TOKEN=<YOUR_BOT_TOKEN>
Go to the Reddit app portal: https://www.reddit.com/prefs/apps/
Create a "script" type key and name it whatever
Copy your Client ID (not labelled, but found in bold under the name of the script) and the Client Secret (is labelled).
Set environment variables REDDIT_ID=<YOUR_CLIENT_ID>
and the Client Secret as REDDIT_SECRET=<YOUR_CLIENT_SECRET>
Environment variables can be stored in a .env in the directory where the
project is run. In the future, I may decide to use a configuration file instead.
In the examples below, I assume that all API credentials are in their
corresponding environment variables or in a .env file.
git clone https://github.com/lemonase/pastabot.git
cd pastabot
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 src/bot.py
Running with a .env file in the current directory:
docker run -d --env-file $(PWD)/.env jamesdixon/pastabot:latest
Running with environment variables:
docker run -d -e REDDIT_ID=<YOUR_ID> \
-e REDDIT_SECRET=<YOUR_SECRET> \
-e DISCORD_BOT_TOKEN=<YOUR_TOKEN> \
jamesdixon/pastabot
0
0 समीक्षाएं
Reviews can be left only by registered users. All reviews are moderated by Top.gg moderators. Please make sure to check our guidelines before posting.
5 स्टार्स
0
4 स्टार्स
0
3 स्टार्स
0
2 स्टार्स
0
1 स्टार
0
यहाँ अभी तक कोई समीक्षा नहीं है!