--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import tools.smart_start_stream_time
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = ""
+USER_COOLDOWN = 5
+GLOBAL_COOLDOWN = 2
+
+
+def main(bot: Bot, message: Message):
+ start_stream_ts = tools.smart_start_stream_time.start_stream_timestamp()
+ if not start_stream_ts:
+ msg = r"The Sponsor is World of Warships, which is a historical strategy online combat PC game. It looks very 5Head but i will conquer elmoFire so imma be testing it out. If u want to join in with us, try it urself, or if you just want to help me out Gladge u can sign up with my link: https://strms.net/warships_ihaspeks you get a fair few bonuses for using mah link too ihaspeBased and after u have won your first game and bought ur first ship ill get a notification on stream peksJAM"
+ else:
+ msg = r"Peks is live so he can awnser that KEKW but here is the link just in case BASED https://strms.net/warships_ihaspeks"
+ tools.smart_privmsg.send_safe(bot, message.channel, msg)
+
+++ /dev/null
-from aptbot.bot import Message, Commands, Bot
-import tools.smart_privmsg
-import urllib3
-import json
-
-PERMISSION = 99
-PREFIX = "?"
-DESCRIPTION = r""
-USER_COOLDOWN = 30
-GLOBAL_COOLDOWN = 30
-
-header = {
- "Accept": "application/json",
- "User-Agent": "For my twitch bot [MurphyAI] on https://twitch.tv/ihaspeks",
-}
-
-
-def main(bot: Bot, message: Message):
- http = urllib3.PoolManager()
- r = http.request("GET", "https://icanhazdadjoke.com", headers=header)
- if r.status != 200:
- tools.smart_privmsg.send(
- bot, message, f"Couldn't get a joke Sadge", reply=message.tags["id"]
- )
- return
-
- data = json.loads(r.data.decode("utf-8"))
- tools.smart_privmsg.send(bot, message, f"{data['joke']}", reply=message.tags["id"])
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import os
+import logging
+import ttv_api.users
+import sqlite3
+import tools.smart_privmsg
+import random
+import shlex
+
+logger = logging.getLogger(__name__)
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = r"Sekiro death counter"
+USER_COOLDOWN = 10
+GLOBAL_COOLDOWN = 5
+
+PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(PATH, "..")
+
+def check_queue(bot: Bot, message: Message, table: str):
+ conn = sqlite3.connect(os.path.join(PATH, "database.db"))
+ c = conn.cursor()
+
+ c.execute(
+ f"""
+ SELECT id, val FROM varvalues WHERE id = 'cannon';
+ """
+ )
+ _, val = c.fetchone()
+
+ if table == "show":
+ msg = f"Peks is at cannon {val % 1000} of prestige {val // 1000}"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+
+ conn.close()
+ return
+ if table == "remove":
+ val = val - 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks is at cannon {val % 1000} of prestige {val // 1000}"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+ if table == "add":
+ val = val + 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks is at cannon {val % 1000} of prestige {val // 1000}"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+
+
+def parse(query):
+ query = query.split()
+ try:
+ if query[0].lower() == "add":
+ return {"--do": "add"}
+ if query[0].lower() == "remove":
+ return {"--do": "remove"}
+ except:
+ pass
+ return {"--game": "show"}
+ d = dict()
+ for i in shlex.split(query):
+ try:
+ d[i.split('=')[0]] = i.split('=')[1]
+ except:
+ pass
+ return d
+
+
+def scrub(table_name):
+ return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+
+
+def main(bot: Bot, message: Message):
+ args = " ".join(message.value.split(" ")[1:])
+ args = parse(args)
+ check_queue(bot, message, scrub(args.get("--do", "show")))
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import os
+import logging
+import ttv_api.users
+import sqlite3
+import tools.smart_privmsg
+import random
+import shlex
+
+logger = logging.getLogger(__name__)
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = r"Sekiro death counter"
+USER_COOLDOWN = 10
+GLOBAL_COOLDOWN = 5
+
+PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(PATH, "..")
+
+def check_queue(bot: Bot, message: Message, table: str):
+ conn = sqlite3.connect(os.path.join(PATH, "database.db"))
+ c = conn.cursor()
+
+ c.execute(
+ f"""
+ SELECT id, val FROM varvalues WHERE id = 'deadge_sekiro';
+ """
+ )
+ _, val = c.fetchone()
+
+ if table == "show":
+ msg = f"Peks has currently died {val} times"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+
+ conn.close()
+ return
+ if table == "remove":
+ val = val - 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'deadge_sekiro';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has currently died {val} times"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+ if table == "add":
+ val = val + 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'deadge_sekiro';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has currently died {val} times"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+
+
+def parse(query):
+ query = query.split()
+ try:
+ if query[0].lower() == "add":
+ return {"--do": "add"}
+ if query[0].lower() == "remove":
+ return {"--do": "remove"}
+ except:
+ pass
+ return {"--game": "show"}
+ d = dict()
+ for i in shlex.split(query):
+ try:
+ d[i.split('=')[0]] = i.split('=')[1]
+ except:
+ pass
+ return d
+
+
+def scrub(table_name):
+ return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+
+
+def main(bot: Bot, message: Message):
+ args = " ".join(message.value.split(" ")[1:])
+ args = parse(args)
+ check_queue(bot, message, scrub(args.get("--do", "show")))
import tools.smart_privmsg
import urllib3
-PERMISSION = 99
-PREFIX = "?"
+PERMISSION = 9
+PREFIX = "\\"
DESCRIPTION = ""
-USER_COOLDOWN = 90
-GLOBAL_COOLDOWN = 60
+USER_COOLDOWN = 900
+GLOBAL_COOLDOWN = 600
def main(bot: Bot, message: Message):
+++ /dev/null
-from aptbot.bot import Message, Commands, Bot
-import tools.smart_start_stream_time
-
-PERMISSION = 99
-PREFIX = "?"
-DESCRIPTION = ""
-USER_COOLDOWN = 5
-GLOBAL_COOLDOWN = 2
-
-
-def main(bot: Bot, message: Message):
- start_stream_ts = tools.smart_start_stream_time.start_stream_timestamp()
- if not start_stream_ts:
- msg = r"The Sponsor is World of Warships, which is a historical strategy online combat PC game. It looks very 5Head but i will conquer elmoFire so imma be testing it out. If u want to join in with us, try it urself, or if you just want to help me out Gladge u can sign up with my link: https://strms.net/warships_ihaspeks you get a fair few bonuses for using mah link too ihaspeBased and after u have won your first game and bought ur first ship ill get a notification on stream peksJAM"
- else:
- msg = r"Peks is live so he can awnser that KEKW but here is the link just in case BASED https://strms.net/warships_ihaspeks"
- tools.smart_privmsg.send_safe(bot, message.channel, msg)
-
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import tools.smart_privmsg
+import urllib3
+import json
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = r""
+USER_COOLDOWN = 30
+GLOBAL_COOLDOWN = 30
+
+header = {
+ "Accept": "application/json",
+ "User-Agent": "For my twitch bot [MurphyAI] on https://twitch.tv/ihaspeks",
+}
+
+
+def main(bot: Bot, message: Message):
+ http = urllib3.PoolManager()
+ r = http.request("GET", "https://icanhazdadjoke.com", headers=header)
+ if r.status != 200:
+ tools.smart_privmsg.send(
+ bot, message, f"Couldn't get a joke Sadge", reply=message.tags["id"]
+ )
+ return
+
+ data = json.loads(r.data.decode("utf-8"))
+ tools.smart_privmsg.send(bot, message, f"{data['joke']}", reply=message.tags["id"])
from lol_api import summoner_v4
import ttv_api.users
from tools import smart_privmsg
+import json
logger = logging.getLogger(__name__)
PATH = os.path.dirname(os.path.realpath(__file__))
PATH = os.path.join(PATH, "..")
+def find_champion(champ_id: int) -> str:
+ with open(os.path.join(PATH, "data/champion.json"), "r") as f:
+ champion_data = json.load(f)
+ champ_id = str(champ_id)
+ champion_data = champion_data["data"]
+ for champion in champion_data:
+ if champion_data[champion]["key"] == champ_id:
+ return champion_data[champion]["name"]
+ return "404"
def main(bot: Bot, message: Message):
index_skip = 0
except IndexError:
twitch_user = message.tags.get("reply-parent-display-name", message.channel)
twitch_id = message.tags.get(
- "reply-parent-user-id",
- ttv_api.users.get_users(user_logins=[message.channel]),
- )
+ "reply-parent-user-id",
+ ttv_api.users.get_users(user_logins=[message.channel]),
+ )
else:
twitch_id = ttv_api.users.get_users(user_logins=[twitch_user])
if not twitch_id:
logger.warning(
- f"There was an issue getting twitch data for user {twitch_id}; message id was: {message.tags['id']}"
- )
+ f"There was an issue getting twitch data for user {twitch_id}; message id was: {message.tags['id']}"
+ )
smart_privmsg.send(
- bot, message, "Couldn't retrieve data", reply=message.tags["id"]
- )
+ bot, message, "Couldn't retrieve data", reply=message.tags["id"]
+ )
return
if not isinstance(twitch_id, str):
c = conn.cursor()
c.execute(
- """
+ """
SELECT summoner_id, puuid FROM accounts WHERE twitch_id = ?;
""",
(twitch_id,),
- )
+ )
fetched = c.fetchall()
c.execute(
- """
+ """
SELECT twitch_id, summoner_id FROM accounts;
""",
- )
+ )
fetched_all = c.fetchall()
if not fetched:
smart_privmsg.send(
- bot,
- message,
- f"No summoners added for {twitch_user}",
- reply=message.tags["id"],
- )
+ bot,
+ message,
+ f"No summoners added for {twitch_user}",
+ reply=message.tags["id"],
+ )
conn.close()
return
break
else:
smart_privmsg.send(
- bot,
- message,
- f"{twitch_user} is currently not in game. These are all of their summoners: {summoner_names}",
- reply=message.tags["id"],
- )
+ bot,
+ message,
+ f"{twitch_user} is currently not in game. These are all of their summoners: {summoner_names}",
+ reply=message.tags["id"],
+ )
conn.close()
return
for summoner in info.participants:
for f in fetched_all:
if summoner.summoner_id == f[1] and summoner.summoner_id != fetched[0][0]:
- play_with.append(ttv_api.users.get_users(user_ids=[f[0]])[0].display_name),
+ play_with.append(
+ {
+ "name": ttv_api.users.get_users(user_ids=[f[0]])[0].display_name,
+ "champion": find_champion(summoner.champion_id),
+ },
+ )
break
msg = f"{twitch_user} is currently playing a game on: {summoner_names[-1]}"
if play_with:
- msg += f" and is playing with {play_with}."
+ msg += " and is playing with"
+ for player in play_with:
+ msg += f" {player['name']} on {player['champion']} |"
+ msg = msg[:-1] + "."
+
smart_privmsg.send(
- bot,
- message,
- msg,
- reply=message.tags["id"],
- )
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
conn.close()
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import os
+import logging
+import ttv_api.users
+import sqlite3
+import tools.smart_privmsg
+import random
+import shlex
+
+logger = logging.getLogger(__name__)
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = r"Sekiro death counter"
+USER_COOLDOWN = 10
+GLOBAL_COOLDOWN = 5
+
+PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(PATH, "..")
+
+def check_queue(bot: Bot, message: Message, table: str):
+ conn = sqlite3.connect(os.path.join(PATH, "database.db"))
+ c = conn.cursor()
+
+ c.execute(
+ f"""
+ SELECT id, val FROM varvalues WHERE id = 'penta';
+ """
+ )
+ _, val = c.fetchone()
+
+ if table == "show":
+ msg = f"Peks has gotten {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+
+ conn.close()
+ return
+ if table == "remove":
+ val = val - 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has gotten {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+ if table == "add":
+ val = val + 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has gotten {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+
+
+def parse(query):
+ query = query.split()
+ try:
+ if query[0].lower() == "add":
+ return {"--do": "add"}
+ if query[0].lower() == "remove":
+ return {"--do": "remove"}
+ except:
+ pass
+ return {"--game": "show"}
+ d = dict()
+ for i in shlex.split(query):
+ try:
+ d[i.split('=')[0]] = i.split('=')[1]
+ except:
+ pass
+ return d
+
+
+def scrub(table_name):
+ return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+
+
+def main(bot: Bot, message: Message):
+ args = " ".join(message.value.split(" ")[1:])
+ args = parse(args)
+ check_queue(bot, message, scrub(args.get("--do", "show")))
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import os
+import logging
+import ttv_api.users
+import sqlite3
+import tools.smart_privmsg
+import random
+import shlex
+
+logger = logging.getLogger(__name__)
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = r"Sekiro death counter"
+USER_COOLDOWN = 10
+GLOBAL_COOLDOWN = 5
+
+PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(PATH, "..")
+
+def check_queue(bot: Bot, message: Message, table: str):
+ conn = sqlite3.connect(os.path.join(PATH, "database.db"))
+ c = conn.cursor()
+
+ c.execute(
+ f"""
+ SELECT id, val FROM varvalues WHERE id = 'quadra';
+ """
+ )
+ _, val = c.fetchone()
+
+ if table == "show":
+ msg = f"Peks has missed out on {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+
+ conn.close()
+ return
+ if table == "remove":
+ val = val - 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has missed out on {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+ if table == "add":
+ val = val + 1
+ c.execute(
+ f"""
+ UPDATE varvalues SET val = ? WHERE id = 'cannon';
+ """,
+ (val,)
+ )
+
+ msg = f"Peks has missed out on {val} pentas!"
+
+ tools.smart_privmsg.send(
+ bot,
+ message,
+ msg,
+ reply=message.tags["id"],
+ )
+ conn.commit()
+ conn.close()
+ return
+
+
+def parse(query):
+ query = query.split()
+ try:
+ if query[0].lower() == "add":
+ return {"--do": "add"}
+ if query[0].lower() == "remove":
+ return {"--do": "remove"}
+ except:
+ pass
+ return {"--game": "show"}
+ d = dict()
+ for i in shlex.split(query):
+ try:
+ d[i.split('=')[0]] = i.split('=')[1]
+ except:
+ pass
+ return d
+
+
+def scrub(table_name):
+ return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+
+
+def main(bot: Bot, message: Message):
+ args = " ".join(message.value.split(" ")[1:])
+ args = parse(args)
+ check_queue(bot, message, scrub(args.get("--do", "show")))
)
logger.info(f"created table lol_queue_data")
+ c.execute(
+ """
+ CREATE TABLE IF NOT EXISTS ow (
+ twitch_id INTEGER NOT NULL,
+ position INTEGER NOT NULL,
+ available INTEGER NOT NULL,
+ last_available INTEGER,
+ time_remaining INTEGER NOT NULL,
+ team INTEGER,
+ priority_queue INTEGER,
+ PRIMARY KEY (twitch_id)
+ );
+ """
+ )
+ logger.info(f"created table ow")
+
+ c.execute(
+ """
+ CREATE TABLE IF NOT EXISTS ow_data (
+ name TEXT NOT NULL,
+ data INTEGER NOT NULL,
+ PRIMARY KEY (name)
+ );
+ """
+ )
+ logger.info(f"created table ow_data")
+
conn.commit()
conn.close()
)
logger.info(f"created table commands")
+ c.execute(
+ """
+ CREATE TABLE IF NOT EXISTS varvalues (
+ id TEXT NOT NULL,
+ val INTEGER NOT NULL,
+ PRIMARY KEY (id)
+ )
+ """
+ )
+ logger.info(f"created table varvalues")
+
+
+ c.execute(
+ """
+ CREATE TABLE IF NOT EXISTS clips (
+ url TEXT NOT NULL,
+ from_user INTEGER NOT NULL,
+ PRIMARY KEY (url)
+ )
+ """
+ )
+ logger.info(f"created table clips")
+
c.execute(
"""
CREATE TABLE IF NOT EXISTS users (
messages[i] = messages[i][1:]
else:
break
+ messages[i] = messages[i].replace("always", "alwase")
+ messages[i] = messages[i].replace("Always", "Alwase")
+ messages[i] = messages[i].replace("ALWAYS", "ALWASE")
else:
while True:
if (
messages = messages[1:]
else:
break
+ messages = messages.replace("always", "alwase")
+ messages = messages.replace("Always", "Alwase")
+ messages = messages.replace("ALWAYS", "ALWASE")
bot.send_privmsg(channel, messages, reply)