# sqlite databse
*.db
+data/
-aptbot @ git+https://github.com/atheridis/aptbot.git@296c2b730b342268c7b92725d9954fe9eef1ec12
+aptbot @ git+https://github.com/atheridis/aptbot.git@84683f404540292f74892576149e18a3d9d8fb61
python-dotenv==0.20.0
urllib3==1.26.11
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+import tools.smart_privmsg
+import urllib3
+import json
+
+COOLDOWN = 30 * 60
+END_TIME = 0
+
+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")
+ return
+
+ data = json.loads(r.data.decode("utf-8"))
+ joke = data["joke"].replace("\r\n", " ")
+ tools.smart_privmsg.send(
+ bot, message, f"{joke} ||| Get more jokes by typing ?joke"
+ )
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+
+COOLDOWN = 60 * 60
+END_TIME = 0
+
+
+def main(bot: Bot, message: Message):
+ msg = "I collect data and occasionally post interesting statistics on peks' discord. "
+ msg += "The type of data you should expect to see is 'Chat frequency', 'Most used emotes', "
+ msg += "'Most active time and day', 'Reply graphs', etc. "
+ bot.send_privmsg(message.channel, msg)
+
+ msg = "If you are okay with these stats being publicly available with your name, "
+ msg += "please type ?accept_share to let me know. "
+ bot.send_privmsg(message.channel, msg)
from aptbot.bot import Message, Commands, Bot
COOLDOWN = 30 * 60
-END_TIME = 2 * 60 * 60
+END_TIME = 1 * 60 * 60
def main(bot: Bot, message: Message):
+++ /dev/null
-from aptbot.bot import Message, Commands, Bot
-import tools.smart_privmsg
-import urllib3
-import json
-
-COOLDOWN = 20 * 60
-END_TIME = 0
-
-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")
- return
-
- data = json.loads(r.data.decode("utf-8"))
- joke = data["joke"].replace("\r\n", " ")
- tools.smart_privmsg.send(
- bot, message, f"{joke} ||| Get more jokes by typing ?joke"
- )
from datetime import datetime
import tools.smart_start_stream_time
-COOLDOWN = 120
-END_TIME = COOLDOWN * 8
+COOLDOWN = 180
+END_TIME = COOLDOWN * 5
STREAM_SCHEDULE = dt.time(17, 30)
from aptbot.bot import Message, Commands, Bot
-COOLDOWN = 8 * 60
-END_TIME = 2 * 60 * 60
+COOLDOWN = 30 * 60
+END_TIME = 2.5 * 60 * 60
def main(bot: Bot, message: Message):
from aptbot.bot import Message, Commands, Bot
import yt_api.videos
-COOLDOWN = 25 * 60
+COOLDOWN = 30 * 60
END_TIME = 0
CHANNEL_ID = "UCQ7C3NUKY6TSkURdUdVoYFw"
--- /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 tools.smart_privmsg
+import os
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = ""
+USER_COOLDOWN = 30
+GLOBAL_COOLDOWN = 15
+
+
+COMMANDS_PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(COMMANDS_PATH, "..")
+DATA_PATH = os.path.join(PATH, "data")
+
+
+def main(bot: Bot, message: Message):
+ accepted_path = os.path.join(DATA_PATH, "permission")
+ with open(accepted_path, "r") as f:
+ accepted = [user_id.rstrip() for user_id in f]
+ if message.tags["user-id"] in accepted:
+ tools.smart_privmsg.send(bot, message, "You have already given permission")
+ return
+
+ with open(accepted_path, "a") as f:
+ f.write(f"{message.tags['user-id']}\n")
+ tools.smart_privmsg.send(bot, message, "Thank you for giving permission")
+
+++ /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 tools.smart_privmsg
+import os
+import random
+
+PERMISSION = 99
+PREFIX = "?"
+DESCRIPTION = ""
+USER_COOLDOWN = 30
+GLOBAL_COOLDOWN = 15
+
+
+COMMANDS_PATH = os.path.dirname(os.path.realpath(__file__))
+PATH = os.path.join(COMMANDS_PATH, "..")
+DATA_PATH = os.path.join(PATH, "data")
+
+
+def main(bot: Bot, message: Message):
+ accepted_path = os.path.join(DATA_PATH, "jokes")
+ with open(accepted_path, "r") as f:
+ jokes = [user_id.rstrip() for user_id in f]
+ joke = random.choice(jokes)
+
+ tools.smart_privmsg.send(bot, message, f"{joke}", reply=message.tags["id"])