From 0fcd5b89aeeff69e510138528443ab0918f32566 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Fri, 9 Feb 2024 16:18:59 -0500 Subject: [PATCH] Fixed missing await, reported by ab3800 (props) and updated mirrors in README --- README.md | 3 +-- cancer.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cabfa0b..8dc2ce1 100644 --- a/README.md +++ b/README.md @@ -45,5 +45,4 @@ Try it out, join **#superbowl** on *irc.supernets.org* now, we have beer! ___ -###### Mirrors -[acid.vegas](https://git.acid.vegas/cancer) • [GitHub](https://github.com/acidvegas/cancer) • [GitLab](https://gitlab.com/acidvegas/cancer) • [SuperNETs](https://git.supernets.org/acidvegas/cancer) +###### Mirrors for this repository: [acid.vegas](https://git.acid.vegas/cancer) • [SuperNETs](https://git.supernets.org/acidvegas/cancer) • [GitHub](https://github.com/acidvegas/cancer) • [GitLab](https://gitlab.com/acidvegas/cancer) • [Codeberg](https://codeberg.org/acidvegas/cancer) diff --git a/cancer.py b/cancer.py index b9a696d..363d8c5 100644 --- a/cancer.py +++ b/cancer.py @@ -29,16 +29,16 @@ import ssl import time # Connection -server = 'irc.server.com' +server = 'irc.supernets.org' port = 6697 use_ipv6 = False use_ssl = True vhost = None -channel = '#chats' +channel = '#dev' key = None # Identity -nickname = 'CANCER' +nickname = '[DEV]CANCER' username = 'smokesome' realname = 'git.acid.vegas/cancer' @@ -92,21 +92,21 @@ def ssl_ctx(): return ctx class Generate: # degenerate * - def can(chan, target): + async def can(chan, target): beer_choice = random.choice(['bud','modelo','ultra']) beer_temp = random.choice(['a piss warm','an ice cold','an empty']) if beer_choice == 'bud': beer = '{0}{1}{2}'.format(color(' ', white, white), color(' BUD ', white, random.choice((blue,brown))), color('c', grey, white)) - await self.action(chan, f'throws {color(target, white)} {temp} {beer} =)') + await Cancer.action(chan, f'throws {color(target, white)} {beer_temp} {beer} =)') if luck(100): await asyncio.sleep(2) - await self.action(chan, 'suddenly feels more gay...') + await Cancer.action(chan, 'suddenly feels more gay...') elif beer_choice == 'modelo': beer = '{0}{1}{2}'.format(color(' ', orange, orange), color('Modelo', blue, yellow), color('c', grey, orange)) # props to opal - await self.action(chan, f'throws {color(target, white)} {temp} {beer} =)') + await Cancer.action(chan, f'throws {color(target, white)} {beer_temp} {beer} =)') elif beer_choice == 'modelo': beer = '{0}{1}'.format(color(' ULTRA ', blue, white), color('🬃', red, white)) # warm - await self.action(chan, f'throws {color(target, white)} {temp} {beer} =)') + await Cancer.action(chan, f'throws {color(target, white)} {beer_temp} {beer} =)') def beer(): glass = color(' ', light_grey, light_grey) @@ -399,7 +399,7 @@ class Bot(): target = nick elif len(args) == 2: target = args[1] - Generate.can(chan, target) + await Generate.can(chan, target) elif msg == '!chainsmoke' and not self.event: self.status = False self.event = 'chainsmoke' @@ -456,7 +456,6 @@ class Bot(): await self.raw(f'KILL {nick} CANCER KILLED {nick.upper()} - QUIT SMOKING TODAY! +1 800-QUIT-NOW') else: object = Generate.cigarette(self.stats['hits']) if msg == '!smoke' else Generate.joint(self.stats['hits']) - cigarette = Generate.cigarette(self.stats['hits']) if self.fat: for i in range(3): await self.sendmsg(chan, object) @@ -470,4 +469,5 @@ class Bot(): break # Main -asyncio.run(Bot().connect()) +Cancer = Bot() +asyncio.run(Cancer.connect())