#!/usr/bin/env python
from time import sleep
from random import randint, shuffle
from sys import argv
from twitchio.ext import commands
import logging
logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)
#sleep for random between 1s and 5m
sleep(randint(1,300))
class Bot(commands.Bot):
def __init__(self):
# Initialise our Bot with our access token, prefix and a list of channels to join on boot...
super().__init__(
token=argv[1],
prefix='',
initial_channels=['#hitsquadgodfather']
)
async def event_ready(self):
# We are logged in and ready to chat and use commands...
#logging.info(f'Logged in as | {self.nick}')
lst = ['!gauntlet', '!hitsquad', '!battleroyale']
shuffle(lst)
for x in lst:
logging.info(f'{self.nick} is sending: {x}')
await bot.connected_channels[0].send(x)
sleep(randint(31,83))
logging.info('Sent all msgs, sleeping...')
# sleep(randint(28803,31038))
# logging.info(f'Slept!\n')
bot = Bot()
bot.run()