示例#1
0
 def __init__(self, name, content, uid):
     self.Title = name
     self.Content = content
     self.UID = uid
     self.Time = getTime()
     self.NumRead = 0
示例#2
0
 def __init__(self, UID, name, location):
     self.UID = UID
     self.name = name
     self.location = location
     self.time = getTime()
示例#3
0
 def __init__(self, FanUID, BloggerUID):
     self.FanUID = FanUID
     self.BloggerUID = BloggerUID
     self.time = getTime()
示例#4
0
 def __init__(self, UID, AID, content, is_reply):
     self.AID = AID
     self.UID = UID
     self.content = content
     self.IsReply = is_reply
     self.time = getTime()
示例#5
0
 def __init__(self, UID, AID):
     self.UID = UID
     self.AID = AID
     self.Time = getTime()
示例#6
0
async def on_message(message):
    try:
        #print(message.channel.name)
        user = "******"
        try:
            print(getTime() + " " + message.channel.server.name + ": " + message.channel.name + ": " + user.format(message) + ": " + message.content)
        except AttributeError:
            print(getTime() + " PM: " + " " + user.format(message) + ": " + message.content)
        if message.content.startswith('!deleteme'):
            msg = await client.send_message(message.channel, 'I will delete myself now...')
            await client.delete_message(msg)
        if (message.content.startswith("!reload")) and (user.format(message) == "Hayleethegamer"):
            if "full" in message.content:
                try:
                    importlib.reload(Simple_Commands)
                    importlib.reload(Chat_Commands)
                    importlib.reload(NonCommand_Chat)
                    importlib.reload(Admin_Commands)
                    await client.send_message(message.channel,"Commands Reloaded " + user.format(message))
                    errors = 0
                    stopped = 0
                except:
                    await client.send_message(message.channel,"```" + str(sys.exc_info()[1:2]) + "```")
            else:
                try:
                    importlib.reload(Simple_Commands)
                    importlib.reload(Chat_Commands)
                    importlib.reload(NonCommand_Chat)
                    importlib.reload(Admin_Commands)
                    await client.send_message(message.channel,"Commands Reloaded " + user.format(message))
                    errors = 0
                    stopped = 0
                except:
                    await client.send_message(message.channel,"```" + str(sys.exc_info()[1]) + "```")
        await Simple_Commands.simpleCommands(message,client,user)
        await Chat_Commands.chatCommands(message,client,user)
        await NonCommand_Chat.noncommandChat(message,client,user)
        await Admin_Commands.adminCommands(message,client,user)
        if (message.content.startswith("!add")) and (user.format(message) == "Hayleethegamer"):
            if "addSimple=1" in fileRead("Vars/addSimple.txt"):
                importlib.reload(Simple_Commands)
                importlib.reload(Chat_Commands.Blame_Command)
                varChange("addSimple.txt","addsimple=0")
                #addBlame = 1
            print("reloaded Simple")
        if (message.content.startswith("!error restart")) and (user.format(message) == "Hayleethegamer"):
            errors = 0
            stopped = 0
    except OSError:
        if osError == False:
            osError = True
            await client.send_message(message.channel,"There was an OSError, I am turning  myself now")
            subprocess.call("Files/Kill-9.sh")
            sys.exit(2)
    except: #Exception as ex:
        #error = str(sys.exc_info())
        #codeWrite("Log/Log1.txt",error[1:len(error)])	
        #await client.send_message(message.channel,"```" + error[1:len(error)]) + "``` \n Uh Oh, you found a bug...")
        #logTraceback(ex)
        errors += 1
        if (errors >= 5) and (stopped == 0):
                await sendMessage(message.channel,"Uh oh, I've sent to many errors, I'll stop now")
                stopped = 1
        elif errors <= 5:
                await client.send_message(message.channel,"``` " + str(sys.exc_info()[1:2]) + " ``` \n There was a bug")