Compare commits
3 Commits
163992f85a
...
5edc69c29e
Author | SHA1 | Date |
---|---|---|
Lucidiot | 5edc69c29e | |
Lucidiot | 157c973365 | |
Lucidiot | 0244f28177 |
|
@ -15,6 +15,8 @@ def safe_length(text):
|
|||
|
||||
@plugin.listener('limit')
|
||||
def limit(ctx):
|
||||
if not ctx.channel.endswith('30characters'):
|
||||
return
|
||||
text_length = safe_length(ctx.text)
|
||||
if text_length == 30:
|
||||
return
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
from pinhook import plugin
|
||||
|
||||
|
||||
@plugin.command(
|
||||
'?say',
|
||||
help_text='Make the bot talk.',
|
||||
ops=True,
|
||||
ops_msg='This is an administrators-only command.',
|
||||
)
|
||||
def say(ctx):
|
||||
args = (ctx.arg or '').split(maxsplit=1)
|
||||
if len(args) < 2:
|
||||
return plugin.message('Usage: ?say <channel/user> <message>')
|
||||
ctx.privmsg(*args)
|
||||
|
||||
|
||||
@plugin.command(
|
||||
'?action',
|
||||
help_text='Make the bot do something (/me)',
|
||||
ops=True,
|
||||
ops_msg='This is an administrators-only command.',
|
||||
)
|
||||
def action(ctx):
|
||||
args = (ctx.arg or '').split(maxsplit=1)
|
||||
if len(args) < 2:
|
||||
return plugin.message('Usage: ?action <channel/user> <message>')
|
||||
ctx.action(*args)
|
||||
|
||||
|
||||
@plugin.command(
|
||||
'?notice',
|
||||
help_text='Send a notice to someone from the bot.',
|
||||
ops=True,
|
||||
ops_msg='This is an administrators-only command.',
|
||||
)
|
||||
def notice(ctx):
|
||||
args = (ctx.arg or '').split(maxsplit=1)
|
||||
if len(args) < 2:
|
||||
return plugin.message('Usage: ?notice <channel/user> <message>')
|
||||
ctx.notice(*args)
|
|
@ -0,0 +1,16 @@
|
|||
from math import ceil
|
||||
from pinhook import plugin
|
||||
from thirtybot.helpers import Color, color, bold, underline
|
||||
|
||||
bad_glyphs = set('Ee℮𝚎∈𝖾Єℯ𝕖⋳ᗴəᵉꗋ𝔼𝙴ΕᎬ𝘌Ɛ⋿ⴹ𝖤ƸꜪℇĘɛεЕꜫȨéèëêēẽÉÈÊËĒĔẼĖėĘęĚěЕе')
|
||||
|
||||
@plugin.listener('oulipo')
|
||||
def oulipo(ctx):
|
||||
if not ctx.channel.endswith('oulipo'):
|
||||
return
|
||||
sins = ''.join(set(ctx.text) & bad_glyphs)
|
||||
if not sins:
|
||||
return
|
||||
# Copy sins up to 30 glyphs
|
||||
msg = (sins * ceil(30 / len(sins)))[:30]
|
||||
return plugin.message(bold(underline(color(Color.White, Color.Red, msg))))
|
Loading…
Reference in New Issue