GithubHelp home page GithubHelp logo

bitbot's Introduction

Bitbot

A minimal IRC bot that was built for me, not you.

Installation

Direct install

go get github.com/bbriggs/bitbot && go install github.com/bbriggs/bitbot

Docker

docker run --rm -it bbriggs/bitbot --help

note: For persistent data you may want to mount a volume to /tmp or whatever path you specify for the embedded DB. For certain plugins to load, bitbot expects a postgres DB. Also remember that if you're running in Docker, your Prometheus bind address must be 0.0.0.0 + some port and you must publish that port using -p

docker-compose

See the example deployment

Helm

See the helm chart

Usage

A Golang IRC bot powered by Hellabot

Usage:
  bitbot [flags]

Flags:
  -c, --channels strings     channels to join
      --config string        config file (default is ./config.yaml)
      --dbHost string        Postgresql host
      --dbName string        Postgresql database name
      --dbPass string        Postgresql password
      --dbPort string        Postgresql port
      --dbSSLMode string     Postgresql SSL Mode
      --dbUser string        Postgresql user
      --embedded-db string   The path to the embedded DB
  -h, --help                 help for bitbot
  -n, --nick string          nickname
      --nickserv string      nickserv password
      --operPass string      oper password
      --operUser string      oper username
      --prom                 enable prometheus
      --promAddr string      Prometheus metrics address and port
  -s, --server string        target server
      --ssl                  enable ssl

All flags are also supported as config file parameters.

---
server: "irc.secops.space:6697"
nickServ: "hunter2"
operUser: "your-oper-username"
operPass: "correct-horse-battery-staple"
channels:
  - "#main"
  - "#bots"
  - "#bitbot"
nick: "bitbot"
ssl: "true"
prom: "true"
promAddr: "127.0.0.0.1:8080"
admins:
  "[email protected]"
prom: "true"
promAddr: "0.0.0.0:8080"
dbuser: "bitbot"
dbpass: "bitbot"
dbhost: "127.0.0.1"
dbport: "5432"
dbsslmode: "disable"
# Plugins available to load are defined in cmd/bot.go
plugins:
  - "roll"
  - "skip"
  - "info"
  - "shrug"
  - "urlReader"

Contributing

See our contributing guide

License

Bitbot is available under the MIT License

bitbot's People

Contributors

bbriggs avatar c-sto avatar dependabot[bot] avatar jrwren avatar m-242 avatar ombratteng avatar parsec avatar paulgwebster avatar pj290 avatar pusty avatar rfc2119 avatar skidd0 avatar staticnotdynamic avatar therealsuser avatar wadadli avatar zombeej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitbot's Issues

feature request - s/old/new/

chattr1: It has almost everything I use on the daily
chattr1: s/on the daily/daily/
bitbot: chattr1 meant to say: It has almost everything I use daily

Unable to setup bitbot on local system

Did follow the README.md to setup the project locally but it was quite unsuccessful.
Please update README.md , step by step to setup the project and run it

Note: There is no test files to know the project was setup correctly.

I'm getting lost in the docker thing.

Update or Remove DeepSource configuration file.

This bug in the .deepsource.toml makes me believe that this file has been merged from one of @staticnotdynamic's pull requests, and not rewritten to fit this repository.

While it would be a very simple fix, I have not heard of deepsource and have no idea of the costs it brings, so I guess we should discuss it here.

Bitbot crashes on very large titles

The jerks geniuses at 0x00sec discovered that a web page with a large title (ie, several gigs) will crash the bot. Limit the number of bytes read from the title.

Fix `version.go`

We need to put the build info in the version.go file,so that the !info trigger can anwser properly.

Missing error checks (and a couple more)

Keeping this here for future references:

  1. no error checks when binding flags with viper

    viper.BindPFlag("server", rootCmd.PersistentFlags().Lookup("server"))

  2. one more error check here

    res.Body.Close()

  3. printf-style function with dynamic format string and no further arguments should use print-style function instead

    content := fmt.Sprintf(x)

    content := fmt.Sprintf(x)

Explanation for the third point

Using fmt.Printf with a dynamic first argument can lead to unexpected output. The first argument is a format string, where certain character combinations have special meaning. If, for example, a user were to enter a string such as

Interest rate: 5%

and you printed it with

fmt.Printf(s)

.. it would lead to the following output:

Interest rate: 5%!(NOVERB).

Similarly, forming the first parameter via string concatenation with user input should be avoided for the same reason. When printing user input, either use a variant of fmt.Print, or use the %s Printf verb and pass the string as an argument.

Fix docker-build.sh

The docker-build.sh file is broken in two ways:

  • The final echo doesn't properly print special characters.
  • It prints that bitbot has been compiled, even then the build failed.

Anti spam module

A trigger that, when activated by opers would kick everyone not in an "known not spammers" list, and set mode +i.
Would make someone's spamming attempt easier to stop.

Feature Request - Add the PUMP command

#pump abuse.txt
bitbot(internal dialog ... god damn this guy)
bitbot, let me look in https://github.com/ircart/ircart/blob/master/big/abuse.txt
bitbot: yeah its here ....
PUMPIN ... cat https://github.com/ircart/ircart/blob/master/big/abuse.txt

ALL ABOARD THE ABUSE CABOOSE!
CHUGGA-GHUGGA-CHOO-CHOO!
(o (o (o (o (o (o(o)
==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+-[________]
||______)<+--+--+--+--+
\\oo\\oo\'oo\OOOO-|\oo\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-+--+--+--+--+--+--+--+--+--+--+--+--+--+
\\\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-+--+--+--+--+--+--+--+--+--+--+--+--+--+
\\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
<+--+--+--+--+--+--+--+--+--+--+--+--+--+
_\\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
.
)<--+--+--+--+--+--+--+--+--+--+--+--+--+
\
\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
)
[.
)<-+--+--+--+--+--+--+--+--+--+--+--+--+
o\
\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
)
o)
][.
__)<+--+--+--+--+--+--+--+--+--+--+--+--+
\oo\\\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o)
(o)
][.
)<--+--+--+--+--+--+--+--+--+--+--+--+
|\oo\
\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o)
(o)
][.
)<-+--+--+--+--+--+--+--+--+--+--+--+
-|\oo\
\\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o(o)
(o)
n
][.
_____)<+--+--+--+--+--+--+--+--+--+--+--+
O-|\oo\
\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o(o)
(o)
n
][.
)<--+--+--+--+--+--+--+--+--+--+--+
OO-|\oo\
\\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o(o)
(o)
n_n][.
___)<-+--+--+--+--+--+--+--+--+--+--+
OOO-|\oo\
\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o (o(o)
(o)
n_n
][.
________)<+--+--+--+--+--+--+--+--+--+--+
OOOO-|\oo\
\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o(o)
_ (o)
|n_n][.
|
__)<--+--+--+--+--+--+--+--+--+--+
\OOOO-|\oo\\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o(o)
__ (o)
o|n_n_][.
|________)<-+--+--+--+--+--+--+--+--+--+
o\OOOO-|\oo\
\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o(o)
___ (o)
o|n_n][.
|______)<+--+--+--+--+--+--+--+--+--+
oo\OOOO-|\oo\\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o (o (o(o)
____ (o)
]o|n_n][.
||)<--+--+--+--+--+--+--+--+--+
'oo\OOOO-|\oo\_\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o(o)
_____ (o)
]o|n_n][.
_||
)<-+--+--+--+--+--+--+--+--+
'oo\OOOO-|\oo\\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o(o)
_____ (o)
] ]o|n_n][.
]
||
)<+--+--+--+--+--+--+--+--+
\'oo\OOOO-|\oo\_\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o (o (o (o(o)
= _____ (o)
] ]o|n_n][.
]||
)<--+--+--+--+--+--+--+--+
o\'oo\OOOO-|\oo\\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o(o)
== _____ (o)
] ]o|n_n][.
__]
||
)<-+--+--+--+--+--+--+--+
oo\'oo\OOOO-|\oo\_\\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o(o)
=== _____ (o)
E ] ]o|n_n][.
]||
)<+--+--+--+--+--+--+--+
\oo\\oo\'oo\OOOO-|\oo\_\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o (o (o (o (o(o)
==== _____ (o)
SE ] ]o|n_n][.
___]|
|)<--+--+--+--+--+--+--+
\oo\'oo\OOOO-|\oo\_\\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o(o)
==== _____ (o)
USE ] ]o|n_n][.
_____]
||
)<-+--+--+--+--+--+--+
\\oo\'oo\OOOO-|\oo\_\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o(o)
==== _____ (o)
BUSE ] ]o|n_n][.
]||
)<+--+--+--+--+--+--+
\\oo\'oo\OOOO-|\oo\_\\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
o (o (o (o (o (o(o)
==== _____ (o)
ABUSE ] ]o|n_n][.
______]|
|
)<--+--+--+--+--+--+
o\\oo\'oo\OOOO-|\oo\_\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
___==== _____ (o)
ABUSE ] ]o|n_n][.
________]
||
)<-+--+--+--+--+--+
oo\\oo\'oo\OOOO-|\oo\_\\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][.
[
]_||)<+--+--+--+--+--+
\oo\\oo\'oo\OOOO-|\oo\_\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][.
-[
]_||)<--+--+--+--+--+
\oo\\oo\'oo\OOOO-|\oo\_\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+[
]||______)<-+--+--+--+--+
\\oo\\oo\'oo\OOOO-|\oo\
\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+-[________]
||______)<+--+--+--+--+
\\oo\\oo\'oo\OOOO-|\oo\\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--[________]
||______)<--+--+--+--+
\\\oo\\oo\'oo\OOOO-|\oo\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+[________]
||______)<-+--+--+--+
\\\oo\\oo\'oo\OOOO-|\oo\\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+-[________]
||______)<+--+--+--+
\\\\oo\\oo\'oo\OOOO-|\oo\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--[________]
||______)<--+--+--+
\\\\oo\\oo\'oo\OOOO-|\oo\\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+[________]
||______)<-+--+--+
\\\\\oo\\oo\'oo\OOOO-|\oo\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+-[________]
||______)<+--+--+
\\\\\oo\\oo\'oo\OOOO-|\oo\\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--[________]
||______)<--+--+
\\\\\\oo\\oo\'oo\OOOO-|\oo\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+[________]
||______)<-+--+
\\\\\\oo\\oo\'oo\OOOO-|\oo\\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
__==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+-[________]
||______)<+--+
\\\\\\\oo\\oo\'oo\OOOO-|\oo\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
_==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--[________]
||______)<--+
\\\\\\\oo\\oo\'oo\OOOO-|\oo\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--+[________]
||______)<-+
\\\\\\\\oo\\oo\'oo\OOOO-|\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--+-[________]
||______)<+
\\\\\\\\oo\\oo\'oo\OOOO-|\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--+--+[________]
||)<
\\\\\\\\\oo\\oo\'oo\OOOO-|\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--+--+-[
__]
||)<
\\\\\\\\\\oo\\oo\'oo\OOOO-|\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][.
-+--+--+--+--+--+--[
__]
||)
\\\\\\\\\\oo\\oo\'oo\OOOO-|\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
____==== _____ (o)
[ ABUSE ] ]o|n_n][
-+--+--+--+--+--+--+[
__]
||______
\\\\\\\\\\\oo\\oo\'oo\OOOO-|\o
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o)
==== _____ (o
[ ABUSE ] ]o|n_n]
-+--+--+--+--+--+--+-[________]
|__|

\\\\\\\\\\\oo\\oo\'oo\OOOO-|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(o
==== _____ (
[ ABUSE ] ]o|n_n
-+--+--+--+--+--+--+--[________]
||

\\\\\\\\\\\\oo\\oo\'oo\OOOO-|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o(
____==== _____
[ ABUSE ] ]o|n_n
-+--+--+--+--+--+--+--+[________]
||___
\\\\\\\\\\\\oo\\oo\'oo\OOOO-
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (o
_==== _____
[ ABUSE ] ]o|n_n
-+--+--+--+--+--+--+--+-[________]
|__|

\\\\\\\\\\\\\oo\\oo\'oo\OOOO
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o (
___==== _____
[ ABUSE ] ]o|n
-+--+--+--+--+--+--+--+--[________]
||

\\\\\\\\\\\\\oo\\oo\'oo\OOO
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o
____==== _____
[ ABUSE ] ]_o|n
-+--+--+--+--+--+--+--+--+[________]
||
\\\\\\\\\\\\\\oo\\oo\'oo\OO
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (o
__==== _____
[ ABUSE ] ]o|
-+--+--+--+--+--+--+--+--+-[________]
|__|

\\\\\\\\\\\\\\oo\\oo\'oo\O
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o (
_==== _____
[ ABUSE ] ]o|
-+--+--+--+--+--+--+--+--+--[________]
||
\\\\\\\\\\\\\\\oo\\oo\'oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o
____==== ____
[ ABUSE ] ]_o
-+--+--+--+--+--+--+--+--+--+[
______]
|__
\\\\\\\\\\\\\\\oo\\oo\'oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o
==== ___
[ ABUSE ] ]

-+--+--+--+--+--+--+--+--+--+-[________]
|

\\\\\\\\\\\\\\\\oo\\oo\'o
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (o
==== __
[ ABUSE ] ]
-+--+--+--+--+--+--+--+--+--+--[________]
|
\\\\\\\\\\\\\\\\oo\\oo\'
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o (
==== _
[ ABUSE ]
-+--+--+--+--+--+--+--+--+--+--+[________]

\\\\\\\\\\\\\\\\\oo\\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o
====
[ ABUSE ]
-+--+--+--+--+--+--+--+--+--+--+-[____]
\\\\\\\\\\\\\\\\\oo\\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (o
====
[ ABUSE
-+--+--+--+--+--+--+--+--+--+--+--[
\\\\\\\\\\\\\\\\\\oo\\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o (
===
[ ABUSE
-+--+--+--+--+--+--+--+--+--+--+--+[

\\\\\\\\\\\\\\\\\\oo\\o
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o
==
[ ABUSE
-+--+--+--+--+--+--+--+--+--+--+--+-[

\\\\\\\\\\\\\\\\\\\oo\\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (o
=
[ ABUS
-+--+--+--+--+--+--+--+--+--+--+--+--[_
\\\\\\\\\\\\\\\\\\\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o (
____
[ ABU
-+--+--+--+--+--+--+--+--+--+--+--+--+[

\\\\\\\\\\\\\\\\\\\\oo\
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o
___
[ AB
-+--+--+--+--+--+--+--+--+--+--+--+--+-[
\\\\\\\\\\\\\\\\\\\\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(o
__
[ A
-+--+--+--+--+--+--+--+--+--+--+--+--+--[__
\\\\\\\\\\\\\\\\\\\\\oo
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
(
_
[
-+--+--+--+--+--+--+--+--+--+--+--+--+--+[
\\\\\\\\\\\\\\\\\\\\\o
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

bitbot leaves channel upon mentioning it

Description

bitbot silently leaves a channel he's in upon starting seeing a phrase that matches the regex "^bitbot.*". Thoughts @m-242 ?

version: version v1.2.2 (heads/v1.2.2/a2be240)

Steps to reproduce

Saying "bitbot" at the beginning of your sentence will make it part

Event Setting Trigger

This trigger would be used to set up events with several members of a channel participating to it.

The event takes place at a given time, has a channel in which all participating people must be, a description, and an author with elevated privileges on the reminder.
For simplicity's sake, a reminder object also has a unique id.

At an event's time, the bot should send a message in the channel containing the event description, and the interested people's nicknames.

The trigger has an activating keyword that might change in the future, but will be considered to be !reminder for now.

Following that main keyword should be other keywords precising the action that should be executed:

  • list : lists exisiting reminders in the calling channel in the id | description | author | interested people | time of event format.
  • time : outputs UTC time, to help that don't live in Greenwich get an idea of when is an event taking place.
  • add $TIME $DESC : adds a reminder in the message's channel, with the message author as an event author. People should sign for an event themselves, to avoid reminder spam, except for the author that should be added in the interested people's list by default.
    The bot should reply with the event's id, description and set time.
  • remove $ID : Checks that the event's designed by it's id's author is the one making the call, and then deletes the event.
  • join $ID : Adds the message author to the event's interested people's list.
  • part $ID : Removes the message author from the event's interested people's list.

Other commands might make the command easier to use, like a command allowing to alter an event, but these will be looked into after creating this basis.

Limit babble size to avoid kick

bitbot keeps on getting kicked out of the channel for Flood. We must limit the babble's size, or slow the replies frequency down, to avoid this.

Privesc with fantasy commands.

Bitbot by nature will echo out any url title, while this is ok for most situations, in a specific set of circumstances it can be used to take over an IRC channel by an unauthenticated user.

You can reproduce this by registering a channel on an irc server, enabling fantasy commands (!voice, !op..etc) registering bitbot with nickserv, inviting a services bot into the channel, giving bitbot elevated access with chanserv and pasting a url with the title set to "!op badguysname".

Bitbot with echo the title of the webpage, in this case "!op badguysname" chanserv will recognize the command "!op badguysname" because bitbot is on the access this.

If you some reason you feel like giving bitbot oper privs...well..you get the point..

Ignorelist

Bitbot should have a way to ignore some chatters, to avoid picking up on other bots, for instance.

A way this could be done, while not necessarily the best possible way, is to have a message consuming trigger at the very beginning of the trigger queue, that activates only when the message sender is in the ignorelist.

Crashing on short HTTP title elements

The solution to #20 actually caused a new issue: the bot crashes on titles that are shorter than the allocated buffer for reading titles in.

panic: runtime error: slice bounds out of range

goroutine 58 [running]:
github.com/bbriggs/bitbot/bitbot.traverse(0xc420132930, 0x0, 0x0, 0x912b00)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:51 +0x111
github.com/bbriggs/bitbot/bitbot.traverse(0xc420132700, 0x0, 0x0, 0x0)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:55 +0xb5
github.com/bbriggs/bitbot/bitbot.traverse(0xc420132690, 0x0, 0x0, 0xc42021a200)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:55 +0xb5
github.com/bbriggs/bitbot/bitbot.traverse(0xc420132540, 0xc4200f7160, 0xc420132540, 0x0)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:55 +0xb5
github.com/bbriggs/bitbot/bitbot.GetHtmlTitle(0x7f528f67aa00, 0xc4200f7140, 0xc4200f7140, 0x7f528f67aa00, 0xc4200f7140)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:70 +0x8a
github.com/bbriggs/bitbot/bitbot.lookupPageTitle(0xc42001c5e6, 0x11, 0x0, 0x0)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:37 +0x128
github.com/bbriggs/bitbot/bitbot.glob..func4(0xc4204d8280, 0xc4201e06e0, 0x1)
        /home/lkw/go/src/github.com/bbriggs/bitbot/bitbot/links.go:17 +0x38
github.com/bbriggs/bitbot/vendor/github.com/whyrusleeping/hellabot.(*Bot).handleIncomingMessages.func1(0xc4204d8280, 0xc4201e06e0)
        /home/lkw/go/src/github.com/bbriggs/bitbot/vendor/github.com/whyrusleeping/hellabot/hellabot.go:120 +0xa7
created by github.com/bbriggs/bitbot/vendor/github.com/whyrusleeping/hellabot.(*Bot).handleIncomingMessages
        /home/lkw/go/src/github.com/bbriggs/bitbot/vendor/github.com/whyrusleeping/hellabot/hellabot.go:118 +0x11a

Feature Request - Standardised API for extending functionality

This would be a standard JSON REST API that allowed modules to be connected from remote hosts, so people could dynamically add functions to bitbot, the CLI for them would be as so:

<daemon> bitbot, runmod daemon:superpump3 suser
<bitbot> passing 'suser' to 'superpump3' provided by 'daemon'

daemon would need an auth key created by an administrator to connect his module, different levels or limits could be possible set per account.

Popular commands should also be aliasable, so:
<fraq> bitbot aliasmod daemon:superpump3 pumpsuser
<bitbot> OK! daemon:superpump3 <-> pumpsuser
<daemon> #pumpsuser
<bitbot> .....

Troll Launcher Module

For a certain someone in our IRC, we should write a Troll Launcher module. I'm thinking we could probably use !roll for some of the functionality and just have a file with some random funny lines. We'll see though...

Update Readme

The README and the example-config.yaml files need to be updated.

For instance, we need to explicit that the db must be put up with docker-compose, and that the db's infos must be put in the example-config.yaml as such:

... Rest of config ...
prom: "true"
promAddr: "0.0.0.0:8080"
dbuser: "bitbot"
dbpass: "bitbot"
dbhost: "127.0.0.1"
dbport: "5432"
dbsslmode: "disable"

contributing.md

As a few more people want to help with bitbot, having a contributing.md would avoid to have to repeat the same explanations over and over again.

Update references in `go.mod` file

Some dependencies are marked wrongly in the go.mod file and can contribute to the creation of bugs on the building of the project (pseudo-version errors).

Fix and extend `!ipinfo`

Due to a bad formatting of the reply message, the !ipinfo trigger (file bitbot/ipinfo.go) only outputs the IP given in argument.

We could also add whois and other functionnalities to the trigger, but this would probably ask for the trigger to be renamed.

Automate the Markov triggers seeding.

We need to be able to seed the probability table and clear it (triggers babble and Markov).
As we do not want to spam a channel every time bitbot is re-trained, or having to copy-paste lots of text, it must be done in Private Message, by bitbot itself.

In a sense

Add controls to re-initialize (clear) and bootstrap markov model

Commands should be !markov reset and !markov init

reset should reinitialize the model and set it back to a fresh state

init should pull in a sample/base corpus and pass it to the markov model for training. Desired base texts are K&R C manual, King James Bible, and maybe a copy of a good sci-fi novel for good measure.

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.