Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insight on your library? #4

Closed
Ruleofthree opened this issue Jun 16, 2019 · 0 comments
Closed

Insight on your library? #4

Ruleofthree opened this issue Jun 16, 2019 · 0 comments

Comments

@Ruleofthree
Copy link

Ruleofthree commented Jun 16, 2019

I'm using your library for my attempt to create a bot. But it's not quite clear on some things - or maybe it is - I'm not a professional developer. I may be missing something.

Is there a command to have the bot wait for a specific response? Example: "What is your name?" Then the bot waits for person that executed the command to respond, store that in a variable, then reply with "Welcome, ::name::."

I can't seem to 1) have the bot wait for said response, and 2) Store response, once it is given, in a variable. The on_MSG command states the variable is 'message' But when run a print command on message, it's always just the input that triggered the command itself (i.e '!create')

Code as follows:

def on_MSG(self, character, message, channel):
        super().on_MSG(character, message, channel)
        if message == "!create":
            super().MSG("ADH-64f8d1b633ed80256a6a", "I did it!")
            basics = self.basics(character, message)
            # abilities = self.abilities(basics)
            # self.save(basics, abilities)

    def on_PRI(self, character, message):
        super().on_PRI(character, message)

    def basics(self, character, message):
        levelDict = {1: [ 25,  1,   6,   15,   2,  1,  5,    75]}
        unspoiledDesire = "ADH-xxxxxxxxxxxxxxxxxxxx"
        # As this is character creation, level will always be equal to 1, and xp always equal to 0
        playerLevel = 1
        playerXP = 0
        # Grabs character's name, and then assigns appropriate values from the dictionary above to display.
        super().PRI(character, "What is your characters name? ")
        time.sleep(10)
        super().MSG(unspoiledDesire, message)`

From my understanding, message should at least be "What is your characters name? " As that was the last string stored in the variable, message.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant