Compare commits
2 Commits
1b71e73757
...
a7b0de90bf
Author | SHA1 | Date | |
---|---|---|---|
a7b0de90bf | |||
c33cd58f4e |
|
@ -3,11 +3,4 @@ It's like Sopel, except rewritten from scratch using Twisted as a base and over
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
Python 3.6+
|
Python 3.6+
|
||||||
System packages: `enchant`
|
Python packages: `twisted python-dateutil requests bs4 wolframalpha emoji pillow ipython numpy numpngw`
|
||||||
Python packages: `twisted python-dateutil requests bs4 wolframalpha pyenchant emoji pillow ipython numpy numpngw`
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
Fix the movie table
|
|
||||||
Consider re-adding the following modules: `etymology, ip`
|
|
||||||
Add CTCP responses
|
|
||||||
More complex versioning
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ op = ['~', '!', '@', '%']
|
||||||
@module.require_chanmsg
|
@module.require_chanmsg
|
||||||
@module.require_admin
|
@module.require_admin
|
||||||
@module.commands('kick')
|
@module.commands('kick')
|
||||||
@module.example(".kick faggot being a faggot")
|
@module.example(".kick Rob It's time to stop.")
|
||||||
def kick(bot, trigger):
|
def kick(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Kick a user from the channel.
|
Kick a user from the channel.
|
||||||
|
@ -38,7 +38,7 @@ def kick(bot, trigger):
|
||||||
@module.require_chanmsg
|
@module.require_chanmsg
|
||||||
@module.require_admin
|
@module.require_admin
|
||||||
@module.commands('ban')
|
@module.commands('ban')
|
||||||
@module.example(".ban faggot")
|
@module.example(".ban Rob")
|
||||||
def ban(bot, trigger):
|
def ban(bot, trigger):
|
||||||
"""
|
"""
|
||||||
This give admins the ability to ban a user.
|
This give admins the ability to ban a user.
|
||||||
|
@ -56,7 +56,7 @@ def ban(bot, trigger):
|
||||||
@module.require_chanmsg
|
@module.require_chanmsg
|
||||||
@module.require_admin
|
@module.require_admin
|
||||||
@module.commands('unban')
|
@module.commands('unban')
|
||||||
@module.example(".unban faggot")
|
@module.example(".unban Rob")
|
||||||
def unban(bot, trigger):
|
def unban(bot, trigger):
|
||||||
"""
|
"""
|
||||||
This give admins the ability to unban a user.
|
This give admins the ability to unban a user.
|
||||||
|
@ -74,6 +74,7 @@ def unban(bot, trigger):
|
||||||
@module.require_chanmsg
|
@module.require_chanmsg
|
||||||
@module.require_admin
|
@module.require_admin
|
||||||
@module.commands('kickban')
|
@module.commands('kickban')
|
||||||
|
@module.example(".kickban Rob It's time to stop.")
|
||||||
def kickban(bot, trigger):
|
def kickban(bot, trigger):
|
||||||
"""
|
"""
|
||||||
This gives admins the ability to kickban a user.
|
This gives admins the ability to kickban a user.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
"""
|
||||||
Marks a user as away with an optional message and informs anyone who attempt
|
Marks a user as away with an optional message and informs anyone who attempt
|
||||||
to ping them of their away status. Goes away when the user talks again.
|
to ping them of their away status. Goes away when the user talks again.
|
||||||
|
|
|
@ -10,7 +10,7 @@ from module import commands, example, require_admin
|
||||||
from tools import configureHostMask
|
from tools import configureHostMask
|
||||||
|
|
||||||
@commands('banhe')
|
@commands('banhe')
|
||||||
@example('.banhe assfaggot 30m')
|
@example('.banhe Rob 30m')
|
||||||
def banhe(bot, trigger):
|
def banhe(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Bans he for a set period of time. Admins may set the period of time,
|
Bans he for a set period of time. Admins may set the period of time,
|
||||||
|
@ -32,7 +32,7 @@ def banhe(bot, trigger):
|
||||||
bot.mode(trigger.channel, True, "b", mask=banmask)
|
bot.mode(trigger.channel, True, "b", mask=banmask)
|
||||||
|
|
||||||
if period > 2592000:
|
if period > 2592000:
|
||||||
bot.reply("It's too big, Onii-chan.")
|
bot.reply("Onii-chan, It's too big!")
|
||||||
if not period or period > 2592000:
|
if not period or period > 2592000:
|
||||||
return bot.msg(f"Banned \x0304{banhee}\x03 for \x0309∞\x03 seconds.")
|
return bot.msg(f"Banned \x0304{banhee}\x03 for \x0309∞\x03 seconds.")
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ def banheall(bot, trigger):
|
||||||
bot.mode(trigger.channel, True, "b", mask=banmask)
|
bot.mode(trigger.channel, True, "b", mask=banmask)
|
||||||
|
|
||||||
if period > 2592000:
|
if period > 2592000:
|
||||||
bot.reply("It's too big, Onii-chan.")
|
bot.reply("Onii-chan, It's too big!")
|
||||||
if not period or period > 2592000:
|
if not period or period > 2592000:
|
||||||
return bot.msg("Banned \x0304them all\x03 for \x0309∞\x03 seconds.")
|
return bot.msg("Banned \x0304them all\x03 for \x0309∞\x03 seconds.")
|
||||||
|
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Provides a countdown to some particular date.
|
|
||||||
"""
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from module import commands, example
|
|
||||||
from tools.time import relativeTime
|
|
||||||
|
|
||||||
|
|
||||||
@commands("countdown")
|
|
||||||
@example(".countdown 2012 12 21")
|
|
||||||
def generic_countdown(bot, trigger):
|
|
||||||
"""
|
|
||||||
.countdown <year> <month> <day> - displays a countdown to a given date.
|
|
||||||
"""
|
|
||||||
if len(trigger.args) < 2:
|
|
||||||
return bot.msg("Please use correct format: .countdown 2012 12 21")
|
|
||||||
text = trigger.args[1]
|
|
||||||
|
|
||||||
text = text.split()
|
|
||||||
if (len(text) != 3 or not text[0].isdigit() or not text[1].isdigit()
|
|
||||||
or not text[2].isdigit()):
|
|
||||||
return bot.msg("Please use correct format: .countdown 2012 12 21")
|
|
||||||
try:
|
|
||||||
date = datetime(int(text[0]), int(text[1]), int(text[2]))
|
|
||||||
except:
|
|
||||||
return bot.msg("Please use correct format: .countdown 2012 12 21")
|
|
||||||
|
|
||||||
msg = relativeTime(datetime.now(), date)
|
|
||||||
msg += " until " + trigger.args[1]
|
|
||||||
bot.msg(msg)
|
|
|
@ -34,7 +34,7 @@ def setup(bot):
|
||||||
|
|
||||||
@commands("hangman", "hm")
|
@commands("hangman", "hm")
|
||||||
@example(".hangman --start")
|
@example(".hangman --start")
|
||||||
@example(".hm anus")
|
@example(".hm substation")
|
||||||
def hangman(bot, trigger):
|
def hangman(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Plays hangman. --start [-s] to start a new game, otherwise words are
|
Plays hangman. --start [-s] to start a new game, otherwise words are
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Long live the Internet of Things!
|
|
||||||
"""
|
|
||||||
import requests
|
|
||||||
|
|
||||||
import module
|
|
||||||
|
|
||||||
|
|
||||||
@module.require_admin
|
|
||||||
@module.commands('lamp')
|
|
||||||
def lampToggle(bot, trigger):
|
|
||||||
"""
|
|
||||||
Turns my lamp on and off. The glory of IoT!
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
res = requests.get("http://192.168.1.12/gpio?0=toggle", timeout=10)
|
|
||||||
except requests.exceptions.ReadTimeout:
|
|
||||||
return bot.msg("Connection error. Timeout reached.")
|
|
||||||
except requests.exceptions.ConnectionError:
|
|
||||||
return bot.msg("Connection error. Is the unit dead?")
|
|
||||||
if res.text[32] == 'L':
|
|
||||||
bot.msg("Lamp is now OFF.")
|
|
||||||
elif res.text[32] == 'H':
|
|
||||||
bot.msg("Lamp is now ON.")
|
|
||||||
|
|
||||||
|
|
||||||
#@module.require_admin
|
|
||||||
@module.commands('roomtemp')
|
|
||||||
def roomTemp(bot, trigger):
|
|
||||||
"""
|
|
||||||
Gets the temperature of my room.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
res = requests.get("http://192.168.1.25/", timeout=10)
|
|
||||||
except requests.exceptions.ReadTimeout:
|
|
||||||
return bot.msg("Connection error. Timeout reached.")
|
|
||||||
except requests.exceptions.ConnectionError:
|
|
||||||
return bot.msg("Connection error. Is the unit dead?")
|
|
||||||
bot.msg(res.text)
|
|
||||||
|
|
||||||
|
|
||||||
@module.require_admin
|
|
||||||
@module.commands('inkwrite')
|
|
||||||
def inkWrite(bot, trigger):
|
|
||||||
"""
|
|
||||||
Writes shit to my e-ink screen.
|
|
||||||
"""
|
|
||||||
text = trigger.replace(".inkwrite ", "")
|
|
||||||
if not text:
|
|
||||||
return bot.msg("Need something to write.")
|
|
||||||
|
|
||||||
try:
|
|
||||||
res = requests.get(f"http://192.168.1.125:8000/?text={text}",
|
|
||||||
timeout=10)
|
|
||||||
except requests.exceptions.ReadTimeout:
|
|
||||||
return bot.msg("Connection error. Timeout reached.")
|
|
||||||
except requests.exceptions.ConnectionError:
|
|
||||||
return bot.msg("Connection error. Is the unit dead?")
|
|
||||||
bot.msg("Wrote: " + res.text)
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Let me google that for you.
|
|
||||||
"""
|
|
||||||
from module import commands
|
|
||||||
|
|
||||||
@commands('lmgtfy')
|
|
||||||
def googleit(bot, trigger):
|
|
||||||
"""Let me just... google that for you."""
|
|
||||||
if len(trigger.args) < 2:
|
|
||||||
return bot.msg('http://google.com/')
|
|
||||||
bot.msg('http://lmgtfy.com/?q=' + trigger.args[1].replace(' ', '+'))
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Minecraft is a well-crafted program.
|
|
||||||
"""
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
import module
|
|
||||||
|
|
||||||
|
|
||||||
@module.require_admin
|
|
||||||
@module.commands('mc_start')
|
|
||||||
def minecraft_start_server(bot, trigger):
|
|
||||||
"""
|
|
||||||
Starts the minecraft server in case it crashes.
|
|
||||||
"""
|
|
||||||
cmd = ["tmux", "send", "-t", "main:2", "./start.sh", "ENTER"]
|
|
||||||
cmd_re = ["tmux", "send", "-t", "main:2", "^C", "ENTER"]
|
|
||||||
msg = "Start signal sent to the minecraft server."
|
|
||||||
if len(trigger.args) >= 2:
|
|
||||||
msg = "Re-" + msg
|
|
||||||
subprocess.run(cmd_re, check=True)
|
|
||||||
subprocess.run(cmd, check=True)
|
|
||||||
bot.msg(msg)
|
|
|
@ -157,7 +157,8 @@ def pickMovie(bot, trigger):
|
||||||
|
|
||||||
@require_admin
|
@require_admin
|
||||||
@commands('addmovie')
|
@commands('addmovie')
|
||||||
@example('.addmovie Gay Niggers From Outer Space')
|
@example('.addmovie Dr. Strangelove or: How I Learned to Stop Worrying and "
|
||||||
|
"Love the Bomb')
|
||||||
def addMovie(bot, trigger):
|
def addMovie(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Adds the specified movie to the movie database.
|
Adds the specified movie to the movie database.
|
||||||
|
|
|
@ -11,7 +11,6 @@ def pingAll(bot, trigger):
|
||||||
attention, or just annoy them.
|
attention, or just annoy them.
|
||||||
"""
|
"""
|
||||||
nicks = list(bot.channels[trigger.channel].users.keys())
|
nicks = list(bot.channels[trigger.channel].users.keys())
|
||||||
for nigger in ["Ishd", "Ishd2", "Ishd_"]:
|
second_class_citizens = ["Ishd", "Ishd2", "Ishd_"]
|
||||||
if nigger in nicks:
|
nicks = [n for n in nicks if n not in second_class_citizens]
|
||||||
nicks.remove(nigger)
|
|
||||||
bot.msg(" ".join(nicks))
|
bot.msg(" ".join(nicks))
|
||||||
|
|
|
@ -17,7 +17,7 @@ def f_reload(bot, trigger):
|
||||||
return boy.reply("Reload what?")
|
return boy.reply("Reload what?")
|
||||||
name = trigger.args[1]
|
name = trigger.args[1]
|
||||||
|
|
||||||
if name == "*" or name.upper() == "ALL THE THINGS":
|
if name == "*":
|
||||||
bot.load_modules()
|
bot.load_modules()
|
||||||
return bot.msg("done")
|
return bot.msg("done")
|
||||||
|
|
||||||
|
|
|
@ -148,23 +148,22 @@ def remind(bot, trigger):
|
||||||
|
|
||||||
|
|
||||||
@commands('at')
|
@commands('at')
|
||||||
@example('.at 13:47 Do your homework!')
|
@example('.at 2012-12-21 18:00:00 End the world.')
|
||||||
@example('.at 16:30UTC-5 Do cocaine')
|
|
||||||
@example('.at 14:45:45 Remove dick from oven')
|
|
||||||
def at(bot, trigger):
|
def at(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Gives you a reminder at the given time and date. Datetime must be in
|
Gives you a reminder at the given time and date. Datetime must be in
|
||||||
YYYY-MM-DD HH:MM:SS format. Only the bot's timezone is used.
|
YYYY-MM-DD HH:MM:SS format. Only the bot's timezone is used.
|
||||||
"""
|
"""
|
||||||
if len(trigger.args) == 1:
|
if len(trigger.args) < 3:
|
||||||
return bot.msg("Missing arguments for reminder command.")
|
return bot.msg("Missing arguments for reminder command.")
|
||||||
if len(trigger.args) == 2:
|
if len(trigger.args) < 4:
|
||||||
reminder = ''
|
reminder = ''
|
||||||
else:
|
else:
|
||||||
reminder = ' '.join(trigger.args[2:])
|
reminder = ' '.join(trigger.args[3:])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
at_time = datetime.strptime(trigger.args[1], '%Y-%m-%d %H:%M:%S')
|
at_time = datetime.strptime(' '.join(trigger.args[1:2]),
|
||||||
|
'%Y-%m-%d %H:%M:%S')
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return bot.msg("Datetime improperly formatted.")
|
return bot.msg("Datetime improperly formatted.")
|
||||||
diff = at_time - datetime.now()
|
diff = at_time - datetime.now()
|
||||||
|
|
|
@ -48,7 +48,7 @@ def setup(bot):
|
||||||
|
|
||||||
@commands("scramble", "sc")
|
@commands("scramble", "sc")
|
||||||
@example(".scramble --start")
|
@example(".scramble --start")
|
||||||
@example(".sc anus")
|
@example(".sc substation")
|
||||||
def scramble(bot, trigger):
|
def scramble(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Plays scramble. --start [-s] to start a new game, otherwise arguments
|
Plays scramble. --start [-s] to start a new game, otherwise arguments
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Fulvia Spelling correction module
|
Correct the last thing you or someone else said. Uses standard sed
|
||||||
|
substitute notation eg. s/search/replace/flags
|
||||||
This module will fix spelling errors if someone corrects them
|
|
||||||
using the sed notation (s///) commonly found in vi/vim.
|
|
||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,8 @@ def setup(bot):
|
||||||
|
|
||||||
@rate(1)
|
@rate(1)
|
||||||
@commands('seen')
|
@commands('seen')
|
||||||
@example(".seen Nigger -l", "Last heard from Nigger at [1997-03-12 16:30:00] "\
|
@example(".seen Dad -l", "Last heard from Dad at [1997-03-12 16:30:00] "\
|
||||||
+"with \"Just going to the store for some smokes babe I'll be right back\"")
|
+"with \"Just going to the store for some cigarettes I'll be right back\"")
|
||||||
@example(".seen Soma_QM", "I haven't seen Soma_QM")
|
@example(".seen Soma_QM", "I haven't seen Soma_QM")
|
||||||
def seen(bot, trigger):
|
def seen(bot, trigger):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Spell checking. Relies on the pyenchant module.
|
|
||||||
"""
|
|
||||||
import enchant
|
|
||||||
|
|
||||||
from module import commands, example
|
|
||||||
|
|
||||||
@commands('spellcheck', 'spell')
|
|
||||||
@example('.spellcheck stuff')
|
|
||||||
def spellcheck(bot, trigger):
|
|
||||||
"""
|
|
||||||
Says whether the given word is spelled correctly, and gives suggestions if
|
|
||||||
it's not.
|
|
||||||
"""
|
|
||||||
if len(trigger.args) < 2:
|
|
||||||
return bot.reply("What word?")
|
|
||||||
word = trigger.args[1]
|
|
||||||
if " " in word:
|
|
||||||
return bot.msg("One word at a time, please")
|
|
||||||
dictionary = enchant.Dict("en_US")
|
|
||||||
|
|
||||||
if dictionary.check(word):
|
|
||||||
bot.msg(word + " is spelled correctly")
|
|
||||||
else:
|
|
||||||
msg = f"{word} is not spelled correctly. Maybe you want one of " \
|
|
||||||
+ "these spellings: "
|
|
||||||
sugWords = []
|
|
||||||
for suggested_word in dictionary.suggest(word):
|
|
||||||
sugWords.append(suggested_word)
|
|
||||||
msg += ", ".join(sugWords)
|
|
||||||
bot.msg(msg)
|
|
|
@ -43,7 +43,7 @@ def topic(bot, trigger):
|
||||||
|
|
||||||
|
|
||||||
@commands('addtopic')
|
@commands('addtopic')
|
||||||
@example('.addtopic Daily reminder to kill all cia niggers on site.')
|
@example(".addtopic We're discussing penises, would you like to join?")
|
||||||
def addTopic(bot, trigger):
|
def addTopic(bot, trigger):
|
||||||
"""
|
"""
|
||||||
Adds the specified topic to the topic database.
|
Adds the specified topic to the topic database.
|
||||||
|
|
|
@ -10,7 +10,7 @@ import requests
|
||||||
|
|
||||||
from module import hook, url_callback
|
from module import hook, url_callback
|
||||||
|
|
||||||
HEADERS = {"User-Agent": "bix nood gimme the title", "Range": "bytes=0-4096"}
|
HEADERS = {"User-Agent": "Give me your data.", "Range": "bytes=0-4096"}
|
||||||
|
|
||||||
@url_callback('puu.sh/')
|
@url_callback('puu.sh/')
|
||||||
def get_puush_fname(bot, url):
|
def get_puush_fname(bot, url):
|
||||||
|
@ -70,6 +70,5 @@ def title_auto(bot, trigger):
|
||||||
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
||||||
title = HTMLParser().unescape(title)
|
title = HTMLParser().unescape(title)
|
||||||
title = title.replace("\n","").strip()
|
title = title.replace("\n","").strip()
|
||||||
#title = title.encode("windows_1252").decode("utf-8")
|
|
||||||
hostname = urlparse(url).hostname
|
hostname = urlparse(url).hostname
|
||||||
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
The bot's version number.
|
|
||||||
"""
|
|
||||||
from module import commands
|
|
||||||
|
|
||||||
@commands('version')
|
|
||||||
def version(bot, trigger):
|
|
||||||
"""Displays the current version of Fulvia running."""
|
|
||||||
bot.reply("Fulvia v1.0.0")
|
|
|
@ -12,7 +12,6 @@ def willilike(bot, trigger):
|
||||||
bot.reply("No.")
|
bot.reply("No.")
|
||||||
|
|
||||||
@commands('upvote')
|
@commands('upvote')
|
||||||
@example('.willilike Banished Quest')
|
|
||||||
def upvote(bot, trigger):
|
def upvote(bot, trigger):
|
||||||
"""An advanced AI that will determine if you like something."""
|
"""Upvotes a post made by someone."""
|
||||||
bot.msg(trigger.nick + " upvoted this post!")
|
bot.msg(trigger.nick + " upvoted this post!")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user