Compare commits

...

3 Commits

Author SHA1 Message Date
Lucidiot 5edc69c29e
Add U+0415 and U+0435
continuous-integration/drone Build is failing Details
2020-10-21 14:58:59 +00:00
Lucidiot 157c973365
Add op commands 2020-10-21 14:58:24 +00:00
Lucidiot 0244f28177
Oulipo plugin 2020-10-15 20:54:02 +00:00
3 changed files with 58 additions and 0 deletions

View File

@ -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

40
thirtybot/plugins/ops.py Normal file
View File

@ -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)

View File

@ -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))))