Code Monkey home page Code Monkey logo

lmaobot's Introduction

LmaoBot

Dank meme bot for Chatango

LmaoBot

How to Make Bot

Use python >=3.8.1 and chatango-lib

Look at requirements.txt to get see what libraries you need. The current bot is async.py and uses a modified version of chatango-lib: LmaoLover/chatango-lib

This library uses asyncio and has many advantages over the old version, but requires working in async style.

Python exceptions

Every error in python will crash your bot and you can't always tell what errors will happen. Use try/except blocks to log errors instead of crashing.

try:
  ...
except Exception as e:
  logError(room.name, "twitter", message.body, e)

Infinite Bot

Your bot will still crash at some point so start your script in an infinite bash loop.

while true
do
    echo "Starting bot..."
    python3 /root/lmaobot/bot.py
    sleep 1
done

If your bot crashes too much then don't do this.

Docker

If you use docker then you don't have to install python libraries manually on your system.

docker build -t lmaobot .

# Edit this script then run the bot
./run_bot.sh

# Stop or restart later
docker restart lmao
docker stop lmao

LmaoBot Features

MEMEs not included

You need to supply your own files like lmao_memes.txt. They are loaded into the code and used like this: memes['lmao']

config.yaml for connection info

username: UserName
password: mypassword
rooms:
    prod:
        - animechat
        - sportchat
    dev:
        - devchat

Use environment variable BOT_PROD to connect to real chat rooms.

BOT_PROD=1 python3 bot.py

rooms.yaml for groups

You want to do different things in different chats so make groups in rooms.yaml then use in the code chat['memers']

memers:
    - coolchat
    - lmaochat
serious:
    - courtroomusa
mod:
    - lmaochat

wolframalpha search

Using ??. Provide your api key in wolfram.yaml:

app_id: ...

lmaobot's People

Contributors

lmaolover avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.