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

modify bot to respond #1339

Closed
loobing opened this issue Sep 17, 2017 · 27 comments
Closed

modify bot to respond #1339

loobing opened this issue Sep 17, 2017 · 27 comments

Comments

@loobing
Copy link

loobing commented Sep 17, 2017

async def cmd_greet(self):
    greet2 = input("hello")
        if(greet2 == "hello"):
            return response ("how are you doing")

i just kinda started coding help me out pls how am i suppose to make it respond if somebody else says hello

@mixieculez
Copy link

mixieculez commented Sep 17, 2017

input() is a built-in function that creates a prompt in console. If you want to make a greet function for Discord members, I recommend that you find a way to pull discord messages and set an if-then statement that way. Also, cmd_ makes it visible as a command in [p]help and therefore means that it would only work if it was invoked by someone as [p]greet. Make it only async def greet(self).

@MeepCastana
Copy link

MeepCastana commented Sep 18, 2017

    if message.content.startswith('hello'):
        await self.send_message(message.channel, 'how are you doing')

under on_message

@loobing
Copy link
Author

loobing commented Sep 18, 2017

Doesnt that means when the bot join the server it will say hello by itself?

@MeepCastana
Copy link

No, it means every time you say hello in chat, the bot will respond

@loobing
Copy link
Author

loobing commented Sep 19, 2017

what if i want to continue the chat example the bot responds how are you doing and the guy says fine and the bot replys do i make a new line for that respond and also what if other people said fine but to their friends and the bot repond

@loobing
Copy link
Author

loobing commented Sep 19, 2017

and also the code doesnt work

@MeepCastana
Copy link

What issue do u have

@loobing
Copy link
Author

loobing commented Sep 19, 2017

i place it under the on_message as you said but i tried saying hello in chat nothing happened

@MeepCastana
Copy link

Send me a screenshot of ur code

@loobing
Copy link
Author

loobing commented Sep 19, 2017

image

@MeepCastana
Copy link

Remove message_content = message.content.strip()

@MeepCastana
Copy link

Class started ill help u in 1 hr

@loobing
Copy link
Author

loobing commented Sep 19, 2017

image
tried already still nothing happened

@loobing
Copy link
Author

loobing commented Sep 19, 2017

cool

@MeepCastana
Copy link

Whats the error?

@loobing
Copy link
Author

loobing commented Sep 19, 2017

Tried nothing happen

@MeepCastana
Copy link

U should have an error

@loobing
Copy link
Author

loobing commented Sep 19, 2017

So what now

@loobing
Copy link
Author

loobing commented Sep 19, 2017

ok now the hello respond worked but i cant command the bot

@loobing
Copy link
Author

loobing commented Sep 19, 2017

and i also put the message_content = message.content.strip() back its now fine(i can command again) but there is still one i need is how do i let the bot respond to the 2nd message example if that the bot says "how are you doing" and the person replies fine then the bot only reply that message fine and not other fine if other people says it

@MeepCastana
Copy link

Make another command that responds to fine

@MeepCastana
Copy link

MeepCastana commented Sep 19, 2017

 if message.content.startswith('fine'):
    await self.send_message(message.channel, 'cool')

so like that

@loobing
Copy link
Author

loobing commented Sep 20, 2017

Some additional stuff do you know how to let the bot play live stream on youtube

@MeepCastana
Copy link

get the review version

@loobing
Copy link
Author

loobing commented Sep 20, 2017

Where?

@mixieculez
Copy link

@loobing The review branch should be here: https://github.com/Just-Some-Bots/MusicBot/tree/review

@loobing
Copy link
Author

loobing commented Sep 20, 2017

thanks for all your help really appreciated

@loobing loobing closed this as completed Sep 20, 2017
@Just-Some-Bots Just-Some-Bots locked and limited conversation to collaborators Feb 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants