PastaBot

Discord 봇

PastaBot

이 봇 등록은 소유권 신청을 기다리는 중입니다

현재 이 봇에 관리자가 없습니다. 소유자라면 클레임하여 등록을 편집하고 소유권을 가져가세요.

소개

A copypasta bot that fetches copypasta... as a Discord message.

PastaBot 🍝

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.

Adding the bot to a server

Anyone is welcome to add the bot!

Here is the link to authorize:

It should have the following permissions in the server:

  • Send Messages
  • Embed Links
  • Use External Emojis

Usage

Commands

Command Prefixes = pastabot! | pasta! | pb! | p!

Full Commands:

  • pasta!get [hot|top|new]

Get a singular copypasta that is \ posts from the top.

  • pasta!list [hot|top|new]

Lists title of the top \ copypasta posts.

  • pasta!rand [hot|top|new] []

Get a random copypasta where \ is the max. (Default is 50)

  • pasta!show

Sends a message with the contents of post body from the URL supplied

Short Commands:

  • pasta!get
  • alias: p!g
  • pasta!list
  • alias: p!l
  • pasta!random
  • alias: p!r
  • pasta!show
  • alias: p!s

Running

Getting API keys

The script currently needs some API credentials from both Discord and Reddit.

Discord Client ID
  1. Go to the Discord API portal:

https://discord.com/developers/applications

  1. Click "New Application" button on top right, name it anything
  1. In the newly created application, go to the "Bot" tab on the menu on the left
  1. Under "Build A Bot" there will be a token label with a Copy button.

Copy that token

  1. Set your environment variable DISCORD_BOT_TOKEN=
Reddit ID and Secret
  1. Go to the Reddit app portal:

https://www.reddit.com/prefs/apps/

  1. Create a "script" type key and name it whatever
  1. Copy your Client ID (not labelled, but found in bold under the name of the script)

and the Client Secret (is labelled).

  1. Set environment variables REDDIT_ID=

and the Client Secret as REDDIT_SECRET=

Storing credentials using dotenv

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.

Running the bot

In the examples below, I assume that all API credentials are in their
corresponding environment variables or in a .env file.

Running Locally
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 Docker

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= \
-e REDDIT_SECRET= \
-e DISCORD_BOT_TOKEN= \
jamesdixon/pastabot

Libraries used

TODOs

  • Upgrade to AsyncPRAW

언어

  • English

리뷰

아직 리뷰가 없습니다 — 첫 번째로 경험을 공유해 보세요.

투표 통계

이 가이드에서 지난 30일 동안 기록된 수치예요.

0 이번 달 투표
0 누적 투표
0 최근 7일
0 고유 투표자 · 30일

최근 30일

  • 투표

요일별

월
화
수
목
금
토
일
PastaBot
PastaBot
0개 서버 · 월 0표
초대