Compare commits

...

2 Commits

Author SHA1 Message Date
Julian Marcos 5458b23efb
tilde_guess: Remove obsolete notifchan
This commit removes the obsolete notifchan and it's associated code from
the program.
Furthermore, this commit removes the importlib library from the file, as
it's not used anywere
2023-09-02 22:06:35 +02:00
Julian Marcos 6d2a05d52c
&water: Ignore file in data/
This commit moves nowater.txt from the root of the project to the data
directory, where it can be kept private.
2023-09-02 22:02:39 +02:00
3 changed files with 3 additions and 7 deletions

View File

View File

@ -2,11 +2,9 @@
import pinhook.plugin import pinhook.plugin
import util.tilde import util.tilde
import importlib
import subprocess import subprocess
from random import randint from random import randint
from decimal import Decimal,ROUND_DOWN,ROUND_UP from decimal import Decimal,ROUND_DOWN,ROUND_UP
notifchan = '#ju-botlog'
CTR = {} CTR = {}
@pinhook.plugin.command('&tildescore', help_text='See how many tildes you have with ju.') @pinhook.plugin.command('&tildescore', help_text='See how many tildes you have with ju.')
@ -80,8 +78,6 @@ def tilde_guess_plugin(msg):
if msg.nick in util.tilde.challenges and (msg.channel == util.tilde.GOOD_CHAN or util.tilde.DEBUG) and not msg.text.startswith('!'): if msg.nick in util.tilde.challenges and (msg.channel == util.tilde.GOOD_CHAN or util.tilde.DEBUG) and not msg.text.startswith('!'):
chalres = util.tilde.challenge_response(msg.nick, msg.timestamp, msg.text) chalres = util.tilde.challenge_response(msg.nick, msg.timestamp, msg.text)
resp = pinhook.plugin.message(chalres[0]) resp = pinhook.plugin.message(chalres[0])
importlib.import_module('os').system('/home/jmjl/bin/juUpdate')
if chalres[1][1] != 0: msg.privmsg(notifchan, f"({chalres[1][0]}) +{chalres[1][1]}")
return resp return resp
@pinhook.plugin.command('&brainwash', help_text='Alias -- &cleanwash') @pinhook.plugin.command('&brainwash', help_text='Alias -- &cleanwash')

View File

@ -15,12 +15,12 @@ verbs = [
class IgnoredUsers: class IgnoredUsers:
def __init__(self): def __init__(self):
if 'nowater.txt' not in listdir(): if 'date/nowater.txt' not in listdir():
open('nowater.txt', 'w').close() open('date/nowater.txt', 'w').close()
@property @property
def users(self): def users(self):
with open('nowater.txt', 'r') as w: with open('date/nowater.txt', 'r') as w:
u = [i.strip() for i in w.readlines() if i.strip()] u = [i.strip() for i in w.readlines() if i.strip()]
return u return u