Update irc.py

This commit is contained in:
therealvorteckz 2023-10-12 10:25:19 -07:00
parent d60395c76f
commit 81a6d8e315
1 changed files with 327 additions and 331 deletions

20
irc.py
View File

@ -1,15 +1,11 @@
from config import config
import time
import ssl
import argparse
import logging
import logging.handlers
import asyncio
import importlib
import time
import sys
import functions
from functions import shop, buyweapon, buyammo, buybandages, shoot, reload, ammo, heal, revive, getmoney, getbandages, removeweapon, createuser, profile, removeuser, setlevel, createuser, punch, checkexist
import sqlite3
# Formatting Control Characters / Color Codes
@ -192,7 +188,7 @@ class Bot(object):
if len(arguments) <= 2 or int(arguments[2]) == 0:
await bot.sendmsg(config.irc.channel, '[You must specify amount of bandages (greater than 0) to purchase]')
else:
value = await buybandages(nick, int(arguments[2]))
value = await functions.buybandages(nick, int(arguments[2]))
await bot.sendmsg(config.irc.channel, f'{value}')
if arguments[0] == '!test':
value = await functions.testfunction(nick)
@ -206,7 +202,7 @@ class Bot(object):
if value != None:
await bot.sendmsg(config.irc.channel, f'{value}')
if arguments[0] == '!ammo':
ammovalue = await ammo(nick)
ammovalue = await functions.ammo(nick)
await bot.sendmsg(config.irc.channel, f'{ammovalue}')
if arguments[0] == '!heal':
value = await functions.heal(nick)
@ -253,8 +249,8 @@ class Bot(object):
data=c.fetchone()
if data is None:
await bot.sendmsg(config.irc.channel, '[Registering Player: %s]'%name)
await createuser(name)
await profile(name)
await functions.createuser(name)
await functions.profile(name)
else:
await bot.sendmsg(config.irc.channel, f'{color("[Player already exists!]", red)}')
@ -279,16 +275,16 @@ class Bot(object):
data=c.fetchone()
if data is None:
await bot.sendmsg(config.irc.channel, f'[Registering Player: %s]'%nick)
await createuser(nick)
await profile(nick)
await functions.createuser(nick)
await functions.profile(nick)
else:
await bot.sendmsg(config.irc.channel, f'{color("[Player already exists!]", red)}')
if arguments[0] == '!profile':
try:
value = await profile(arguments[1].lower())
value = await functions.profile(arguments[1].lower())
await bot.sendmsg(config.irc.channel, f'{value}')
except:
value = await profile(nick)
value = await functions.profile(nick)
await bot.sendmsg(config.irc.channel, f'{value}')
if arguments[0] == '!punch':
await functions.punch(arguments[1].lower(), nick)