JorgeAmVF / reddit-rpg-dice-bot

A simple RPG dice bot for Reddit that uses random in order to simulate the roll of each die in a 7-dice set.

Home Page:https://www.reddit.com/user/RPG_Dice_Bot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reddit RPG Dice Bot

A simple RPG dice bot for Reddit that uses random in order to simulate the roll of each die in a 7-dice set.

Installation

  1. Clone the repository;
  2. run the command prompt;
  3. reach the folder and run py bot.py.

Usage

To change the subreddit where it runs, edit:

for comment in r.subreddit('RPG_Dice_Bot').comments(limit=1000):`

To change a die or to create new dice, edit:

if 'RollD20!' in comment.body and comment.permalink not in dice_rolled:
    comment.reply('*ALEA IACTA EST*: ' + '🎲**' + str(random.randint(1,20)) + '**🎲')
    dice_rolled.append(comment.permalink)
    with open ('dice_rolled.txt', 'a') as f:
        f.write(comment.permalink + '\n')

Credits

A special thanks to Yashar's Reddit Comment Bot code and README for the introductory lessons they provided in the past.

About

A simple RPG dice bot for Reddit that uses random in order to simulate the roll of each die in a 7-dice set.

https://www.reddit.com/user/RPG_Dice_Bot/

License:MIT License


Languages

Language:Python 100.0%