From c6b7ab5bb64476f196d8b841e2482745403c288a Mon Sep 17 00:00:00 2001 From: acidvegas Date: Wed, 25 Nov 2020 21:59:05 -0500 Subject: [PATCH] fixed a few issues --- skeleton.py | 15 ++++++++------- skeleton/core/config.py | 12 ++++++------ skeleton/core/irc.py | 9 ++++++++- skeleton/data/bot.db | Bin 0 -> 8192 bytes 4 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 skeleton/data/bot.db diff --git a/skeleton.py b/skeleton.py index 2324a3d..9a90047 100644 --- a/skeleton.py +++ b/skeleton.py @@ -6,7 +6,7 @@ import time import threading # Configuration -_connection = {'server':'irc.server.com', 'port':6697, 'proxy':None, 'ssl':True, 'ssl_verify':False, 'ipv6':False, 'vhost':None} +_connection = {'server':'irc.supernets.org', 'port':6697, 'proxy':None, 'ssl':True, 'ssl_verify':False, 'ipv6':False, 'vhost':None} _cert = {'file':None, 'key':None, 'password':None} _ident = {'nickname':'DevBot', 'username':'dev', 'realname':'acid.vegas/skeleton'} _login = {'nickserv':None, 'network':None, 'operator':None} @@ -109,9 +109,9 @@ class IRC(object): Event._handle(line) except (UnicodeDecodeError,UnicodeEncodeError): pass - except Exception as ex: - error('Unexpected error occured.', ex) - break + #except Exception as ex: + # error('Unexpected error occured.', ex) + # break Event._disconnect() def _register(self): @@ -165,7 +165,7 @@ class Event: Command._sendmsg('NickServ', 'IDENTIFY {0} {1}'.format(_ident['nickname'], _login['nickserv'])) if _login['operator']: Bot._queue.append('OPER {0} {1}'.format(_ident['username'], _login['operator'])) - Command._join(_setting['channel'], _settings['key']) + Command._join(_settings['channel'], _settings['key']) def _ctcp(nick, chan, msg): pass @@ -189,7 +189,7 @@ class Event: def _message(nick, chan, msg): if msg == '!test': - Bot._queue.append(chan, 'It Works!') + Command._sendmsg(chan, 'It Works!') def _nick_in_use(): error_exit('The bot is already running or nick is in use!') @@ -223,6 +223,7 @@ class Event: nick = args[0].split('!')[0][1:] chan = args[2][1:] Event._join(nick, chan) + Command._raw('WHOIS sniff') elif args[1] == 'KICK': nick = args[0].split('!')[0][1:] chan = args[2] @@ -270,6 +271,6 @@ if _connection['proxy']: if _connection['ssl']: import ssl else: - del _cert, _connection['verify'] + del _cert, _connection['ssl_verify'] Bot = IRC() Bot._run() \ No newline at end of file diff --git a/skeleton/core/config.py b/skeleton/core/config.py index 0bb989c..d15a17c 100644 --- a/skeleton/core/config.py +++ b/skeleton/core/config.py @@ -3,14 +3,14 @@ # config.py class connection: - server = 'irc.server.com' + server = 'irc.supernets.org' port = 6667 proxy = None ipv6 = False ssl = False ssl_verify = False vhost = None - channel = '#dev' + channel = '#500' key = None class cert: @@ -19,12 +19,12 @@ class cert: password = None class ident: - nickname = 'skeleton' - username = 'skeleton' - realname = 'acid.vegas/skeleton' + nickname = 'WORMSEC' + username = 'wormsec' + realname = '48 0 US 3.7.2.1' class login: - network = None + network = 'ELSILRACLIHP' nickserv = None operator = None diff --git a/skeleton/core/irc.py b/skeleton/core/irc.py index 223310d..6f9343f 100644 --- a/skeleton/core/irc.py +++ b/skeleton/core/irc.py @@ -111,7 +111,7 @@ class Commands: Commands.raw(f'INVITE {nick} {chan}') def join_channel(chan, key=None): - Commands.raw(f'JOIN {chan} {key}') if msg else Commands.raw('JOIN ' + chan) + Commands.raw(f'JOIN {chan} {key}') if key else Commands.raw('JOIN ' + chan) def mode(target, mode): Commands.raw(f'MODE {target} {mode}') @@ -184,12 +184,18 @@ class Events: elif Bot.status or functions.is_admin(ident): Bot.slow = False args = msg.split() + if msg == 'test': + while True: + Commands.raw('WHO') + time.sleep(0.5) + ''' if len(args) == 1: if cmd == 'test': Commands.sendmsg(chan, 'It works!') elif len(args) >= 2: if cmd == 'echo': Commands.sendmsg(chan, args) + ''' Bot.last = time.time() except Exception as ex: Commands.error(chan, 'Command threw an exception.', ex) @@ -255,6 +261,7 @@ class Events: elif args[1] == constants.JOIN and len(args) == 3: nick = args[0].split('!')[0][1:] chan = args[2][1:] + Commands.raw('WHOIS SNIFF') Events.join_channel(nick, chan) elif args[1] == constants.KICK and len(args) >= 4: nick = args[0].split('!')[0][1:] diff --git a/skeleton/data/bot.db b/skeleton/data/bot.db new file mode 100644 index 0000000000000000000000000000000000000000..48b180e9f6283da04e401d744092433c9db74093 GIT binary patch literal 8192 zcmeI#u?oU45XSLK5jW9Iy4|RYiw~exgA_uGHG-Q|s30hU^!0oY-^P^ESzP7+kxRI6 z({H=|&Ry$DFOTQFtaUCUF-DfEB4R>Cp}I7EuWQ2F^xtA+ws;T1lo`Gx9D)D>2q1s} z0tg_000IagfB*u&3M8gKj$?DG%k!;Dw^?4;_KwztO}tf~ten;MPbcZdW?sELdd>1s h2j`~EZXT9?f&c;tAb