Compare commits
5 Commits
25741faa93
...
e7bb648f96
Author | SHA1 | Date |
---|---|---|
jmjl | e7bb648f96 | |
jmjl | ad4b711a7c | |
jmjl | 37812b90f7 | |
jmjl | e6054e713d | |
jmjl | 9471383f97 |
|
@ -1,14 +1,7 @@
|
|||
venv/
|
||||
*.log
|
||||
__pycache__/
|
||||
config.json
|
||||
data/
|
||||
json/
|
||||
users/
|
||||
__pycache__/
|
||||
doctorow_ebooks.txt
|
||||
.indexme
|
||||
*.swp
|
||||
*.log
|
||||
config.ini
|
||||
config.json
|
||||
plugins/pronouns.json
|
||||
plugins/ebooks/
|
||||
optout
|
||||
secrets.toml
|
||||
venv/
|
||||
|
|
24
bot.py
24
bot.py
|
@ -8,28 +8,22 @@ with open('config.json') as c:
|
|||
config = json.load(c)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] == '--test-mode':
|
||||
channels = ['#jmjl-devel']
|
||||
nick = 'ju[dev]'
|
||||
prefix_plugins = True
|
||||
cmd_prefix='^'
|
||||
else:
|
||||
channels = config['channels']
|
||||
prefix_plugins = False
|
||||
cmd_prefix='&'
|
||||
nick = 'ju'
|
||||
if len(sys.argv) > 1 and if sys.argv[1] == '--test-mode':
|
||||
channels = config['test']['channels']
|
||||
cmd_prefix = config['test']['cmd_prefix']
|
||||
nick = f"{config['nickname']}{config['test']['nick_suffix']}"
|
||||
prefix_plugins = True
|
||||
else:
|
||||
channels = config['channels']
|
||||
nick = 'ju'
|
||||
cmd_prefix = config['cmd_prefix']
|
||||
nick = config['nickname']
|
||||
prefix_plugins = False
|
||||
cmd_prefix='&'
|
||||
bot = pinhook.bot.Bot(
|
||||
channels,
|
||||
nick,
|
||||
'localhost',
|
||||
ops=['jmjl'],
|
||||
ns_pass='ju {}'.format(config['password']),
|
||||
ops=config['ops'],
|
||||
ns_pass=f"{config['nickname'] {config['password']}",
|
||||
#ns_pass=config['password'],
|
||||
nickserv='nickserv',
|
||||
cmd_prefix=cmd_prefix,
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -111,6 +111,8 @@ def cleanwash_money(msg):
|
|||
#new_balance=((__import__('random').randint(80,110)/100)*balance).split('.')[0]
|
||||
new_balance = Decimal(randint(80,110))/Decimal(100)*Decimal(balance)
|
||||
new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN)
|
||||
percentage_return = new_balance/balance * Decimal(100)
|
||||
percentage_return = percentage_return.quantize(Decimal('.00'), rounding=ROUND_DOWN)
|
||||
#jackpot_balance=(0.10*balance).split('.')[0]
|
||||
jackpot_balance = (Decimal(0.10)*Decimal(balance)).quantize(Decimal('1.'), rounding=ROUND_DOWN)
|
||||
with open(util.tilde.JACKPOT_FILE, "r+") as jackpotfile:
|
||||
|
@ -119,6 +121,6 @@ def cleanwash_money(msg):
|
|||
jackpotfile.truncate()
|
||||
jackpot_now = str(jackpot + jackpot_balance)
|
||||
jackpotfile.write(jackpot_now)
|
||||
message = f"Cleanwashed {balance}TCN, and given the user {new_balance}TCN and contributed {jackpot_balance}TCN to the balance, jackpot at {jackpot_now}TCN"
|
||||
message = f"Cleanwashed {balance}TCN, and given the user {new_balance}TCN ({percentage_return}%) and contributed {jackpot_balance}TCN to the balance, jackpot at {jackpot_now}TCN"
|
||||
util.tilde.admin_update_tilde(nick,amount=new_balance,time=msg.timestamp,comment=message)
|
||||
return pinhook.plugin.message(message)
|
||||
|
|
Loading…
Reference in New Issue