Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
/ Rena Public archive

A news bot for Discord developed via discord.py. It can repost news from Facebook, Twitter, Steam, and Famitsu.

License

Notifications You must be signed in to change notification settings

K0lb3/Rena

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rena

A free news bot for Discord developed in python via discord.py. It supports Facebook, Twitter, Steam, and Famitsu.

Invite Link

Functions

!help

Displays a help message that says how the following two commands have to be used.

!subscribe

!subscribe <link> <src> <dst>

arguments

  • link - a link to the target (Facebook, Twitter)
  • src - (optional) the language code of the original language
  • dst - (optional) the language code of the target language

Please check Google Language Codes to find the correct language codes.

examples

Twitter

!subscribe https://twitter.com/discordapp this will lead to the bot reposting all tweets made by DiscordApp in the channel the command was called.

Facebook

!subscribe https://twitter.com/WOTV_FFBE ja en this will lead to the bot reposting all tweets made by WOTV FFBE in the channel the command was called. The reposted tweets will be translated from Japanese (ja) to English (en).

Famitsu:

!subscribe https://app.famitsu.com/category/game-tips/WOTV_FFBE/ ja en

Steam:

!subscribe https://store.steampowered.com/app/470310/TROUBLESHOOTER_Abandoned_Children/

!unsubscribe

This command can be used to remove a subscription.

!unsubscribe <link> <src> <dst>

The parameters have to be the same as during the subscription.

example

!unsubscribe https://twitter.com/WOTV_FFBE ja en

How it works

The bot fetches the data from the sources via different means. Afterward, the fetched data is formatted into a format that suits discord.

The news from Twitter and Stream are fetched via their respective api.

Facebook's api requirements are too strict for normal developers, so this bot scraps the content from their webpage.

Famitsu has no api, so web scraping is used here as well.

Set-Up

Following python modules are required to run this bot:

  • discord.py - Discord interface
  • pymongo - MongoDB interface
  • bs4 - web scrapper library
  • pygoogletranslation - news translation
  • dnspython - requirement for pygoogletranslation
  • emoji - required for seamless translations

Next to the modules following environment variables have to be set. For testing, this can also be done in settings.py

import os
# twitter login
os.environ["twitter_consumer_key"] = "twitter consumer key"
os.environ["twitter_consumer_secret"] = "twitter consumer secret"
# MongoDB login
os.environ["MDB_USER"] = "mongo db username"
os.environ["MDB_PASS"] = "mongo db password"
# Discord bot login
os.environ["DISCORD_BOT_TOKEN"] = "token of your discord bot"

About

A news bot for Discord developed via discord.py. It can repost news from Facebook, Twitter, Steam, and Famitsu.

Topics

Resources

License

Stars

Watchers

Forks

Languages