示例#1
0
            "no no i don't hate you " + user.get_name() + "..."
        ]

    if "love me" in msg or "like me" in msg:
        return [
            "because you're great, " + user.get_name() + "!",
            "because you're pretty cool, " + user.get_name() + "!",
            "you're just that cool, " + user.get_name() + "!"
        ]

    return None


msg_set = [
    message_set(
        empty, ["are you awake"],
        ["yeah", "yeah i'm awake!", "i am indeed awake", "yup", "yes"]),
    message_set(
        empty, ["can you see this", "can you read this", "you there?"],
        ["yup", "yeah i'm here!", "haha yeah i'm here", "ya i'm here", "yeah"
         ]),
    message_set(awake, ["how long have you been awake"], [
        "i've been up for like %0.", "it's been %0 since i woke up.",
        "currently around %0.", "%0 lol."
    ]),
    message_set(empty, ["tell me a joke"],
                ["if only i was funny :(", "aww i don't know any good ones."]),
    message_set(empty, ["are you gay"], ["no i like girl bots."]),
    message_set(empty, [
        "do my & homework", "do my & hw", "what about my & hw",
        "what about my & homework"
示例#2
0
    
    if name == "cs":
        return ["comp_sci", number]
    
    if name == "ea":
        return ["gen_eng", "205-" + str(number)]
    
    if name == "dtc":
        return ["dsgn", "106-" + str(number)]
    
    return [name, number]

msg_set = [
    message_set(get_course_desc,
                [" course: ", " the & course", "tell me about "],
                ["ooh okay got it. here's a bit about %0 %1:\n\n**%2**\n%3",
                 "i found the course description for %0 %1:\n\n**%2**\n%3",
                 "here's info on %0 %1:\n\n**%2**\n%3"]),
    message_set(get_covid_info,
                ["covid like",
                 "covid is like",
                 "covid cases",
                 "covid-19 like",
                 "covid-19 is like",
                 "covid-19 cases",
                 "covid positivity rate",
                 "coronavirus like",
                 "coronavirus is like",
                 "coronavirus cases",
                 "coronavirus positivity rate"],
                ["hmm, it's %0. the positivity rate atm is %1, with %2 positive cases out of %3 in the past 7 days. " + 
示例#3
0
文件: music.py 项目: dilanx/GamerBot
        r = requests.get(url="https://api.genius.com/search?q=" +
                         urllib.parse.quote_plus(msg),
                         params=PARAMS)
        data = r.json()

        hits = data["response"]["hits"]

        if (len(hits)) == 0:
            return [None, "i couldn't find anything, sorry!"]

        st = ""

        for hit in hits:
            st += "**" + hit["result"]["title"] + "** by " + hit["result"][
                "primary_artist"]["name"] + "\n"

        return [st]

    except:

        return [None, "oh noooo something went wrong i'm sorry :("]


msg_set = [
    message_set(get_by_lyrics, [" song that goes "], [
        "ooh okay maybe it's one of these?\n\n%0",
        "i found these. hopefully it's one of them.\n\n%0",
        "i think i found it?\n\n%0", "hmm maybe it's one of these?\n\n%0",
        "i think you might be talking about one of these.\n\n%0"
    ])
]
示例#4
0
def evaluate_math(message):

    if type(message) == str:
        content = message
    else:
        content = message.content

    if "what is " in content:
        msg = content.partition("what is ")[2]
    else:
        msg = content.partition(": ")[2]

    try:
        ans = cexprtk.evaluate_expression(msg, {})
    except:
        return [None, "sorry i don't understand that math expression :("]

    return [str(ans)]


msg_set = [
    message_set(evaluate_math, [
        " math: ", "evaluate the following mathematical expression: ",
        "do my math hw: ", "do my math homework: "
    ], [
        "good thing i'm a genius. here's what i got: %0",
        "here's the answer: %0", "i have evaluated a solution: %0",
        "da math is done: %0"
    ])
]
示例#5
0
    for i in range(len(r_list)):
        
        r = r_list[i]
        
        st += utility.stamp2human(float(r.time)) + ": " + r.message
        
        if i < len(r_list) - 1:
            st += "\n"
        
    return [st]
        

msg_set = [
    message_set(delete_reminder,
                ["do not remind me to ", " no longer remind me to ",
                 "delete & reminder to ", "remove & reminder to "],
                ["okay. i won't remind you about that anymore.",
                 "sure! i won't remind you about that.",
                 "okay sounds good."]),
    message_set(add_reminder,
                ["remind me to ", " set a reminder to"],
                ["okay! i'll remind you to %1 on %0.",
                 "sounds good. i'll remind you to %1 on %0.",
                 "sure thing. i'll remind you to %1 on %0."]),
    message_set(my_reminders,
                ["my reminders", "going to remind me about"],
                ["here are the things i'll remind you about:\n\n%0",
                 "here's what i'll remind you about:\n\n%0"])
    ]

reminder_msgs = [
    "%0! don't forget to %1!",
示例#6
0
            for i in range(len(word_defs)):

                word_def += "\n" + str(i + 1) + ". " + word_defs[i]

        return [text, word_type, word_def]

    st = data[0]

    for i in range(1, len(data)):
        st += ", " + data[i]

    return [
        None,
        "i couldn't find that word specifically, but here are some words that are close: "
        + st
    ]


msg_set = [
    message_set(get_definition, ["what does & mean"],
                ["here's what i found for %0 (%1):\n%2"]),
    message_set(get_synonyms, ["a synonym for ", "another word for "], [
        "ooh here are some synonyms for %0:\n%1",
        "i found some other words for %0:\n%1"
    ]),
    message_set(get_antonyms, ["the opposite of "], [
        "here are some antonyms for %0:\n%1",
        "i found these antonyms for %0:\n%1"
    ])
]
示例#7
0
        else:
            return [None, "hmm i couldn't find any stock data for that."]

    if "status" in data:
        if data["status"] == "NOT_FOUND":
            return [None, "hmm i couldn't find any stock data for that."]

        if data["status"] == "ERROR":
            return [
                None,
                "i can't afford to do more than 5 requests per minute LMAO how sad."
            ]

    return [data["symbol"], str(data["open"]), str(data["close"])]


msg_set = [
    message_set(get_data, [
        "stock data for ", "stock price of ", "stonk data for ",
        "stonk price of "
    ], [
        "yeah i can do that. here's what i found for %0 (i can't get today's so here's yesterday's):\n\nOpen: %1\tClose: %4\nHigh: %2\tLow: %3",
        "sure! here's stock data for %0 (i can't get today's so here's yesterday's):\n\nOpen: %1\tClose: %4\nHigh: %2\tLow: %3",
        "got it. here's data for %0 (i can't get today's so here's yesterday's):\n\nOpen: %1\tClose: %4\nHigh: %2\tLow: %3"
    ]),
    message_set(crypto_data, ["the value of ", "crypto data for "], [
        "gotcha. here's the value of %0 today:\n\nOpen: %1\tClose: %2",
        "i got it. here's the value of %0 today:\n\nOpen: %1\tClose: %2",
        "ooh sure! here's the value of %0 today:\n\nOpen: %1\tClose: %2"
    ])
]
示例#8
0
        prof = profile_set(name, number, pronouns)

        for i in range(2, len(lines)):
            prof.load_data(lines[i])

        _data[number] = prof


_load()

msg_set = [
    message_set(all_remember, [
        "who all do you remember", "who do you remember", "who all do you know"
    ], [
        "here are the names of everyone i remember: %0 i'd love to meet more people (just tell me to remember your name)!",
        "i remember these people: %0 i'd love to meet more people though (just tell me to remember your name)!",
        "here are all the people i know: %0 i'd love to meet more people (just tell me to remember your name)!"
    ]),
    message_set(
        new,
        ["remember my name is ", "remember that my name is ", "my name is "], [
            "okay %0! i'll remember you.",
            "nice to meet you %0! i'll remember you now."
        ]),
    message_set(pronouns, [
        "remember my pronouns are ", "remember that my pronouns are ",
        "my pronouns are "
    ], ["thanks! i know how to refer to you now.", "okay got it."]),
    message_set(talk_about_all, ["tell me about everyone"], ["%0"]),
    message_set(talk_about_me,
示例#9
0
    utility.planned_joinvc = True
    return [""]


def leave_vc(message):

    if utility.voice_channel == None:
        return [None, "i'm not in a vc."]

    if not utility.voice_channel.is_connected():
        utility.voice_channel = None
        return [None, "i'm not in a vc."]

    utility.planned_leavevc = True
    return [""]


msg_set = [
    message_set(join_vc, [
        "join vc", "join the vc", "join me in vc", "join the voice channel",
        "join voice", "join me in the voice channel", "join me in voice"
    ], [
        "okay, i'll get on.", "be on in a second.",
        "sure, i'll be on in a sec."
    ]),
    message_set(leave_vc, [
        "leave vc", "leave the vc", "disconnect", "leave the voice channel",
        "leave voice channel", "leave voice"
    ], ["alrighty.", "okay i'll go.", "good bye!"])
]
示例#10
0
        return [None, "aww i couldn't find weather data for that place."]

    desc_id = data["weather"][0]["id"]
    desc = data["weather"][0]["description"]
    temp = data["main"]["temp"]
    city = data["name"]

    if desc_id < 300:
        weather = "there's a " + desc
    elif desc_id < 800:
        weather = "there's " + desc
    elif desc_id == 800:
        weather = "clear skies"
    else:
        weather = "there are " + desc

    return [weather, city, str(temp)]


msg_set = [
    message_set(get_weather_data, [
        "what is the weather", "weather in ", "weather at ",
        "weather like in ", "weather like at ", "temperature & in ",
        "temperature & at ", "temp & in ", "temp & at "
    ], [
        "good question! it looks like %0 in %1. the temperature there is %2 °F rn.",
        "ahh yeah %0 in %1 rn at a temperature of %2 °F.",
        "ooh it looks like %0 in %1. it's %2 °F out right now.",
        "just checked and it looks like %0 in %1 at a temp of %2 °F."
    ])
]
示例#11
0
    learn_sets[msg[0]] = msg[1]
    _save()

    return [""]


def _load():

    with open("data/learn.csv") as file:
        reader = csv.reader(file, delimiter=",")
        for line in reader:
            learn_sets[line[0]] = line[1]


def _save():

    with open("data/learn.csv", "w") as file:
        writer = csv.writer(file, delimiter=",")

        for s in learn_sets:
            writer.writerow([s, learn_sets[s]])


_load()

msg_set = [
    message_set(learn, ["learn that & is like saying "], [
        "ooh okay thanks for teaching me!", "ahh okay i'll remember that.",
        "okay got it now thanks!", "ohh so that's what that means. thanks!"
    ])
]
示例#12
0
    try:
        with urllib.request.urlopen("https://api.mojang.com/user/profiles/" +
                                    uuid + "/names") as url:
            data = json.loads(url.read().decode())

        if len(data) < 0:
            return None

        obj = data[len(data) - 1]

        return obj["name"]
    except:
        return None


def get_uuid(username):

    try:
        with urllib.request.urlopen(
                "https://api.mojang.com/users/profiles/minecraft/" +
                username) as url:
            data = json.loads(url.read().decode())

        return [data["id"], data["name"]]
    except:
        return None


msg_set = [
    message_set(get_stats, ["my wed bars stats", "wed bars stats for "], [""])
]
示例#13
0
    msg = message.content.partition(" the element ")[2]

    data = get_data(msg)

    if data is None:
        return [None, "hmm i don't know."]

    if data[4] is None:
        return [None, "aww i don't have a description for that element."]

    return [data[0], data[1], data[4]]


msg_set = [
    message_set(get_all_data, ["element data for "], [
        "okay here's some data i found for %0 (%1):\n\n%4\n\nAtomic number: %2\nAtomic weight: %3"
    ]),
    message_set(get_name, [" name for "], [
        "the name for %0? that's %1.", "i believe the name for %0 is %1.",
        "i think the name for %0 is %1."
    ]),
    message_set(get_symbol, [" symbol for "],
                ["i think the symbol for %0 is %1."]),
    message_set(get_atomic_number, [" atomic number of "],
                ["i believe the atomic number of %0 is %1."]),
    message_set(get_atomic_weight, [" atomic weight of ", " atomic mass of "],
                ["the atomic weight of %0 is %1."]),
    message_set(get_description,
                ["tell me about the element ", "description of the element "],
                ["sure! here's what i know about %0 (%1):\n\n%2"])
]
示例#14
0

def get_name_from_id(id):
    # TEMPORARY UNTIL I FIGURE OUT A BETTER WAY

    return "<@" + id + ">"

    #result = utility.run_sql("select name from cringe_points where user = '******'").fetchall()
    #return result[0]


msg_set = [
    message_set(add_cringe, [
        "give a cringe point to ", "give a cp to ", "add a cringe point to ",
        "add a cp to "
    ], [
        "okay! %0 now has %1 cringe points.",
        "lmao cringee now %0 has %1 cringe points.",
        "%0 now has %1 cringe points."
    ]),
    message_set(view_cringe,
                ["how many cringe points does & have", "how cringe is "], [
                    "looks like %0 has %1 cringe points.",
                    "%0 has %1 cringe points. what a shame.",
                    "%0 has %1 cringe points."
                ]),
    message_set(cringe_leaderboard, ["cringe leaderboard"], [
        "here's the cringe leaderboard:\n\n%0",
        "check out the cringe leaderboard:\n\n%0", "ooh check it out:\n\n%0",
        "here's the leaderboard of cringe:\n\n%0"
    ])
]