Giter Club home page Giter Club logo

cyberpufferbot's Introduction

Cyber Puffer - 赛博河豚🐡

Quick deploy:

First create a channel and add the bot to the channel,

Then post the following settings, and pin that message.

enabled_modules = "uptime, keyword, luck, weibo"

# keyword reply example
[[keywords]]
keyword = "foo"
type = "text"
text = "bar"

And now we can deploy the bot using docker-compose

docker-compose.yml

version: "2.4"
services:
  cyberpuffer:
    image: pufferoverflow/cyberpuffer:latest
    restart: always
    environment:
      API_SECRET: telegram:TELEGRAM_API_TOKEN:CONFIG_CHANNEL_ID
    read_only: true
    ipc: none
    mem_limit: 64M
    memswap_limit: 64M
    network_mode: bridge

Replace TELEGRAM_API_TOKEN and CONFIG_CHANNEL_ID with your own

Commands:

  • /uptime Reply with bot uptime
  • /luck Get today's luck level
  • /weibo [num] Get Weibo's Trending list (Get top 10 by default)

Functions:

  • Reply to keywords with text, sticker or forwarded message

Add your own functions

First make a directory with your mod name and place your program under /modules/

The entrance file name should be the same with directory name.

Then the bot will call the function with the same name with 2 arguments message and sender and expect the same return.

Example: /modules/hello/hello.py

def hello(message: str, sender: dict):
    reply = "Hello World!"
    receiver = sender
    return reply, receiver

Finally add your module name to the enabled_modules section in the config message and restart the bot. The bot should automatically load your function and register the corresponding command.

cyberpufferbot's People

Stargazers

 avatar Dustrain avatar

Watchers

Dustrain avatar PufferOverflow 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.