added fortune.py
This commit is contained in:
parent
1a50e1e444
commit
864dc8d39a
16
modules/fortune.py
Normal file
16
modules/fortune.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Runs the command "fortune -a" and sends the output to channel.
|
||||
"""
|
||||
import subprocess
|
||||
|
||||
from module import commands
|
||||
|
||||
@commands("fortune", "fort")
|
||||
def fortune(bot, trigger):
|
||||
"""
|
||||
print a random, hopefully interesting, adage
|
||||
"""
|
||||
res = subprocess.check_output(["fortune", "-a"])
|
||||
res = res.decode("utf-8").replace("\t", " ")
|
||||
bot.msg(res)
|
Loading…
Reference in New Issue
Block a user