jaspervdj/number-six

语言: Haskell

git: https://github.com/jaspervdj/number-six

Number Six是一款性感的Haskell IRC机器人。
Number Six is a sexy Haskell IRC bot.
README.md (中文)

第六名

Build Status

第六个是为UGent的学生IRC频道开发的自定义IRC机器人。

编译和运行

首先安装库:

cabal configure
cabal build
cabal install

他们,您可以通过复制Sample.hs并从那里开始。 配置它,然后使用以下命令编译和运行:

`ghc --make Sample.hs`
`./Sample`

处理程序

处理程序是对IRC消息作出反应的插件。在这里,我们给出一个简短的列表 可用的处理程序,以及它们提供的命令。

二进制

二进制转换。命令:

  • !bin decimal:将数字转换为二进制表示法
  • !unbin binary:将二进制数转换为十进制表示法
  • !十六进制十进制:将十进制数转换为十六进制表示法
  • !unhex:将十六进制数转换为十进制表示法

炸弹

一个很酷的IRC游戏。

  • 炸弹切口:将炸弹附加到指定的用户。这枚炸弹将踢开   用户在一定时间内(倒计时将可见)。
  • !pass:将炸弹传递给放置炸弹的用户。这个命令可以   只有当前拥有炸弹的人发布。
  • !传递昵称:将炸弹传递给指定的用户

八个球

向聪明的8球处理者提问。命令:

  • !8ball问题:提出问题

饲料

管理Atom / RSS订阅源。新项目将打印到IRC 渠道。

  • !feed添加http://example.com/rss.xml:订阅Feed
  • !feed删除http://example.com/rss.xml:取消订阅Feed
  • !feed list:列出已订阅的Feed

GitHub上

提供GitHub用户的最新操作。命令:

  • !github username:打印给定用户的最新GitHub操作

检查这个服务器上的神是谁,并管理它们。命令:

  • !众神:在这台服务器上展示众神
  • !addgod密码:这会将发件人添加为神。显然,你应该跑   这在私人查询中。
  • !删除上帝:删除你作为一个神。
  • !removegod pattern:删除与给定模式匹配的所有神。

谷歌

使用Google搜索网页。命令:

  • !google查询,!g查询:搜索谷歌查询并返回第一个   找到链接

HackerNews

打印标题并链接到Hacker News上的项目。命令:

  • !hn number:打印当前位于给定位置的项目   黑客新闻。

你好

测试处理程序,只是问候用户。命令:

  • 你好:问候用户

帮帮我

提供信息。命令:

  • !help:打印帮助信息

HTTP

向服务器发送HTTP GET请求并返回状态行,如果您有用,则非常有用 想检查一个网络服务是否为每个人或只是你。命令:

  • !http uri:检查给定的URI

鉴定

系统处理程序,用于设置机器人的昵称和真实姓名。这个 handler没有命令。

IMDB

在IMDB上查看电影。命令:

  • !imdb title:查看给定的电影。

侮辱

侮辱用户。命令:

  • !insult user:侮辱给定的用户。

加入

让机器人加入渠道。机器人将自动加入频道 在配置文件中指定。当机器人被踢出一个 通道,此处理程序将尝试重新加入通道。命令:

  • !join channel:加入指定的频道

LastFM等

检查用户上次在last.fm上收听的曲目。命令:

  • !lastfm username:打印给定用户上次收听的曲目。

NickServ

使用NickServ对bot进行身份验证。此处理程序没有命令。

NowPlaying

在电台上显示当前播放的曲目。命令:

  • !nowplaying station:在给定的电台上打印当前播放的曲目   站

支持的电台:

  • rgrfm,stubru和 急

授予渠道运营商权限。命令:

  • !op nick:给定指定用户的通道操作员权限
  • !deop nick:取消指定用户的频道操作员权限

从列表中选择一个随机项。命令:

  • !pick item1 item2 item3 ...,!who ......:从列表中打印一个随机项目。

ping

对IRC ping的回复。此处理程序没有命令。

书签交易

从subreddit打印随机项。命令:

  • !reddit subreddit:从给定的subreddit中打印一个随机项
  • !reddit subreddit number:打印给定subreddit中的给定项目
  • !reddit:从首页打印随机项
  • !reddit number:从首页打印给定项目

提醒

为自己设置提醒。命令:

  • 提醒一些注意事项:存储一个注释
  • 提醒:收集存储的笔记

休息

打印今天在根特大学餐厅的菜单,另见 https://github.com/blackskad/Resto-menu

  • !resto:打印今天的菜单
  • !恢复日:一天可以是:摩根,明天,过度, 后天

RR

向用户挑战俄罗斯轮盘游戏。命令:

  • !rr username:挑战指定的用户

引用

与史诗报价数据库的接口。命令:

  • !quote:打印随机引用
  • !quote id:使用给定的id打印报价
  • !quote pattern:打印与给定模式匹配的随机引用
  • !lastquote:打印最近添加的报价
  • !addquote quote:向数据库添加引号

让机器人说任意文本。上帝是必需的。命令:

  • !说出频道文字:说出给定频道中的给定文字

检查用户最后一次在频道中看到的时间。命令:

  • !看到的用户名:检查上次看到给定用户的时间

缩短

使用bit.ly缩短URL。命令:

  • !缩短网址:缩短给定的网址

当用户使用sup botname迎接机器人时,机器人会响应 sup用户名。

告诉

向当前离开的用户发送消息。命令:

  • !tell username message:当他成为时,告诉给定用户的消息   活性。

话题

设置频道主题。只有神可以给出这个命令:

  • !主题消息:设置频道主题

TryHaskell

绑定到tryhaskell.org的haskell评估服务。命令:

  • > expression,!haskell expression:评估给定的表达式

TryRuby

绑定到tryruby.org的ruby评估服务。命令:

  • @ expression,!ruby expression:评估给定的表达式

tumblr

从他最后一次翻滚的指定用户那里获得随机翻滚。

  • !tumblr last username:打印slug和最后一个翻滚用户的URL   发布
  • !tumblr用户名:打印slug和来自随机翻滚的URL   用户,目前只考虑最后50个

推特

处理程序由id或用户获取twitters。命令:

  • !twitter username:打印给定用户的最后一条推文
  • !twitter id:用给定的id打印推文

城市词典

在urbandictionary.com上查找表达式。命令:

  • 城市术语:在城市词典中查找给定术语

语音

当人们加入频道时,机器人会给他们发声(+ v)。这也可以 手动设置,尽管这需要上帝特权:

  • !语音缺口:给用户发声
  • !devoice nick,!stfu nick:从用户那里获取声音

天气

他妈的天气怎么样?命令:

  • !weather:打印根特的天气
  • !weather city:打印给定城市的天气

维基百科

在维基百科上查找一个术语。命令:

  • !w term,!wik term,!wiki term:在维基百科上查找给定的术语

YouTube的

在youtube.com上查看视频。命令:

  • !youtube term,!y term:在youtube上查找与给定术语相关的视频

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Number Six

Build Status

Number six is a custom IRC bot, developed for student IRC channels at UGent.

Compiling & Running

Begin by installing the library:

cabal configure
cabal build
cabal install

Them, you can get started by copying Sample.hs and starting from there.
Configure it, then compile & run using:

`ghc --make Sample.hs`
`./Sample`

Handlers

Handlers are plugins which react to IRC messages. Here, we give a short listing
of the available Handlers, together with the commands they provide.

Binary

Binary conversions. Commands:

  • !bin decimal: Convert a number number to binary notation
  • !unbin binary: Convert a binary number to decimal notation
  • !hex decimal: Convert a decimal number to hex notation
  • !unhex: Convert a hex number to decimal notation

Bomb

A cool IRC game.

  • !bomb nick: Attach a bomb to the specified user. This bomb will kick the
    user in a certain amount of time (a countdown will be visible).
  • !pass: Passes the bomb to the user who placed the bomb. This command can
    only be issued by the current person owning them bomb.
  • !pass nick: Passes the bomb to the specified user

EightBall

Ask a question to the wise 8-ball handler. Commands:

  • !8ball question: Ask a question

Feed

Manage Atom/RSS feed subscriptions. New items will be printed to the IRC
channel.

  • !feed add http://example.com/rss.xml: Subscribe to a feed
  • !feed remove http://example.com/rss.xml: Unsubscribe from a feed
  • !feed list: List subscribed feeds

GitHub

Provides the latest action of a GitHub user. Commands:

  • !github username: Prints the latest GitHub action of the given user

Gods

Check who the gods are on this server, and manage them. Commands:

  • !gods: Show the gods on this server
  • !addgod password: This adds the sender as a god. Obviously, you should run
    this in a private query.
  • !removegod: Removes you as a god.
  • !removegod pattern: Removes all gods which match the given pattern.

Google

Searches the web using Google. Commands:

  • !google query, !g query: Searches google for query and returns the first
    link found

HackerNews

Prints the title and link to an item on Hacker News. Commands:

  • !hn number: Prints the item which is currently on the given position on
    Hacker News.

Hello

Test handler, simply greets a user. Commands:

  • !hello: Greet the user

Help

Provides information. Commands:

  • !help: Print help information

Http

Sends an HTTP GET request to a server and returns the status line, useful if you
want to check if a web service is down for everyone or just you. Commands:

  • !http uri: Check the given URI

Identify

System handler which sets the nickname and the real name of the bot. This
handler has no commands.

Imdb

Lookup a movie on IMDB. Commands:

  • !imdb title: Lookup the given movie.

Insult

Insult a user. Commands:

  • !insult user: Insults the given user.

Join

Have the bot join channels. The bot will automatically join the channels
specified in the the configuration file. When the bot is kicked out of a
channel, this handler will try to rejoin the channel. Commands:

  • !join channel: Join the specified channel

LastFm

Check what track a user last listened to on last.fm. Commands:

  • !lastfm username: Print the track the given user last listened to.

NickServ

Authenticates the bot with NickServ. This handler has no commands.

NowPlaying

Show the currently playing track on a radio station. Commands:

  • !nowplaying station: Print the currently playing track on the given radio
    station

Supported radio stations:

Op

Give channel operator privileges. Commands:

  • !op nick: Given channel operator privileges to the specified user
  • !deop nick: Take away channel operator privileges from the specified user

Pick

Pick a random item from a list. Commands:

  • !pick item1 item2 item3 ..., !who ...: Print a random item from the list.

Ping

Replies to IRC ping's. This handler has no commands.

Reddit

Print a random item from a subreddit. Commands:

  • !reddit subreddit: Prints a random item from the given subreddit
  • !reddit subreddit number: Print the given item from the given subreddit
  • !reddit: Print a random item from the front page
  • !reddit number: Print the given item from the front page

Remind

Set reminders for yourself. Commands:

  • !remind some note: Store a note
  • !remind: Collect stored notes

Resto

Print the menu of today in the Ghent University resto's, see also
https://github.com/blackskad/Resto-menu

  • !resto: Print today's menu
  • !resto day: day can be: morgen, tomorrow, overmorgen,
    day after tomorrow

Rr

Challenge a user to a game of russian roulette. Commands:

  • !rr username: Challenge the specified user

Quote

Interface to the epic quote database. Commands:

  • !quote: Prints a random quote
  • !quote id: Prints the quote with the given id
  • !quote pattern: Prints a random quote matching the given pattern
  • !lastquote: Prints the most recently added quote
  • !addquote quote: Adds a quote to the database

Say

Make the bot say arbitrary text. God is required. Commands:

  • !say channel text: Say the given text in the given channel

Seen

Check when a user was last seen in the channel. Commands:

  • !seen username: Check when the given user was last seen

Shorten

Shortens a URL using bit.ly. Commands:

  • !shorten url: Shorten the given URL

Sup

When the user greets the bot with sup botname, the bot will respond with
sup username.

Tell

Send a message to a user who is currently away. Commands:

  • !tell username message: Tell the message to the given user when he becomes
    active.

Topic

Set the channel topic. Only gods may give this command:

  • !topic message: Set the channel topic

TryHaskell

Bindings to the haskell evaluation service of tryhaskell.org. Commands:

  • > expression, !haskell expression: Evaluate the given expression

TryRuby

Bindings to the ruby evaluation service of tryruby.org. Commands:

  • @ expression, !ruby expression: Evaluate the given expression

Tumblr

Get either a random tumble from the specified user of his last tumble.

  • !tumblr last username: Print the slug and the URL for the last tumble user
    posted
  • !tumblr username: Print the slug and the URL from a random tumble made by
    the user, currently only taking the last 50 into account

Twitter

Handler to get twitters by id or user. Commands:

  • !twitter username: Prints the last tweet of the given user
  • !twitter id: Prints the tweet with the given id

UrbanDictionary

Lookup an expression on urbandictionary.com. Commands:

  • !urban term: Looks up the given term on urban dictionary

Voice

When people join the channel, the bot will give them voice (+v). This can also
be set manually, altough this requires god privileges:

  • !voice nick: Give a user voice
  • !devoice nick, !stfu nick: Take voice from a user

Weather

How is the fucking weather? Commands:

  • !weather: Prints the weather in Ghent
  • !weather city: Prints the weather in the given city

Wikipedia

Lookup a term on wikipedia. Commands:

  • !w term, !wik term, !wiki term: Looks up the given term on wikipedia

YouTube

Lookup a video on youtube.com. Commands:

  • !youtube term, !y term: Looks for videos related to the given term on youtube