def mousePressEvent(self, QMouseEvent): if QMouseEvent.button() == Qt.LeftButton: #질문 목록 위젯 닫음 self.chatParent.chatWidget.close() #메시지 전송 타입 답글로 변경 self.chatParent.sendType = False #리플 위젯 생성 및 변수값 대입 self.chatParent.comment_info = self.comments self.tmpSocket = self.chatParent.clientSocket self.chatParent.clientSocket = self.clientSocket replyWidget = reply.Reply(self.chatParent) replyWidget.widgetTmp = self.chatParent.chatWidget replyWidget.clientSocket = self.clientSocket self.chatParent.clientSocket = self.tmpSocket self.chatParent.chatWidget = replyWidget #리플 위젯 화면 뿌려주기 self.chatParent.chatWidget.comment_info = self.comments self.chatParent.chatWidget.replyList = self.chatParent.chatWidget.getReply( ) self.chatParent.chatWidget.showReply() self.chatParent.chatContentLayout.addWidget( self.chatParent.chatWidget) # # 내 질문 목록 위젯 닫음 self.parent.close()
from discord.enums import ActivityType import reply import music import os import discord import youtube_dl from discord.ext import commands from music import Music bot = commands.Bot(command_prefix=commands.when_mentioned_or("!"), description='i am noodel bot') music_bot = Music(bot) @bot.event async def on_ready(): print('Logged in as {0} ({0.id})'.format(bot.user)) print('------') await bot.change_presence(activity=discord.Activity( type=ActivityType.listening, name="!commands")) task = music_bot.audio_player_task() await bot.loop.create_task(task) bot.add_cog(reply.Reply(bot)) bot.add_cog(music_bot) bot.run(os.environ.get('KEY'))
import reply textList = [ "driver.switch_to.active_element", "this code is a one of important snippet for facebook automation." ] text_reply = reply.Reply(textList[0]) print(text_reply.text) text_reply.randomRelpy()
import credentials import callybot_database from datetime import datetime from MySQLdb import OperationalError import restart_VPN import logg import sys sys.stdout = logg.Logger(sys.stdout, open('log.txt', 'a')) # Writes to file and console app = Flask(__name__) credential = credentials.Credentials() db_credentials = credential.db_info db = callybot_database.CallybotDB(db_credentials[0], db_credentials[1], db_credentials[2], db_credentials[3]) replier = reply.Reply(credential.access_token, db) received_message = [] def init(): reminder_interrupt() restart_vpn_interrupt() clear_old_reminders() thread_handler = thread_settings.ThreadSettings(credential.access_token) thread_handler.whitelist("https://folk.ntnu.no/halvorkmTDT4140/") thread_handler.set_greeting( "Hi there {{user_first_name}}!\nWelcome to CallyBot. Press 'Get Started' to get started!" ) thread_handler.set_get_started() return thread_handler.set_persistent_menu()
def preFillScrape(): h = smsHukam.SmsHukam() #engHukam = h.engHukam() gurmukhiHukam = h.gurmukhiHukam() gurmukhiRand = [] for i in range(10): print(f"Done with {i+1}") gurmukhiRand.append(h.gurmukhiRand()) return gurmukhiHukam, gurmukhiRand, h.santJiKhata while True: KeepAlive() sendToEveryOne = timeBasedSending.IfTimeSendSms() toMe = timeBasedSending.ShabadEveryHour() sendToEveryOne.start() #thread 1 toMe.start() #thread 2 gurmukhiHukam, gurmukhiRand, santJiKhata = preFillScrape() r = reply.Reply() while True: r.run(gurmukhiHukam, gurmukhiRand, santJiKhata) #main thread time.sleep(5) a = datetime.datetime.now() nowTime = a.strftime("%I:%M %p") if nowTime == "04:00 AM": #replit sever is 4 hours ahead est, break