Skip to content

Discord bot to automate dOrg tweets through emoji votes

License

Notifications You must be signed in to change notification settings

dOrgTech/boteki

Repository files navigation

Boteki

Simple versatile Discord bot to automate dOrg tweets through emoji votes. You can deploy on your own cloud using docker.

sample usecase of boteki

Get started

  1. Get API keys for Twitter

  2. Set up Discord Bot account and add it to your server. Make sure roles and permissions allow the bot to see the channel where you're sending your commands.

  3. Create a MongoAtlas database and configure connections.

  4. Clone this repo

  5. Set your .env file with these variables,

DISCORD_TOKEN=yourdiscordtoken
DISCORD_GUILD=name of your server

TWITTER_SECRET=twitterapi
TWITTER_CLIENT=twitterkey

ATLAS=database
MONGO_DB_NAME=collection  
  1. Deploy the Docker container with the command docker build -t boteki . and docker run boteki.

Once the bot is running you can call the following commands:

  • !tweet : Set up an emoji vote poll of the tweett and log it in a database
  • !validate: Looks up all the tweets logged on the database, updates the score if possible, and tweets or schedules the tweet.
  • !plznuke: Resets the existing database. use this if the bot breaks during development. Remove this function from the bot before bringing to production to avoid trouble.

Variables

Set up variables on the config.py file, also create a .env with discord, modgo atlas and twitter keys.

Functionalities:

  • Connect Discord bot through official API.
  • Receinve !tweet specific commands on Discord #Twitter channel.
  • Log tweets to a MongoAtlas cloud server.
  • Query database for received tweets.
  • Created basic mongo.py to interact with the cloud server
  • Create a function to nuke the database if needed mogo.nukeDB()
  • Update data on tweets with the !validate command
  • Connect to Twitter through Tweepy
  • Add tweets to queue when !validate is called ()
  • Confirm tweet length and other error handling
  • Make this reproducible witha docker container

Next steps:

  • Create a queue of tweets to post
  • create a !previewcommand to show the queued tweets before sending them
  • Try to link to hubspot profiles and ethereum addresses
  • Establish versions to the Docker requirements to reproduce correct builds
  • Bash script that builds the docker image and runs it
  • Update mongo documents with link to succesfully posted tweets

About

Discord bot to automate dOrg tweets through emoji votes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published