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

guildCreate event is not sending messages #33

Closed
KaToRa192 opened this issue Oct 26, 2020 · 8 comments
Closed

guildCreate event is not sending messages #33

KaToRa192 opened this issue Oct 26, 2020 · 8 comments
Assignees
Labels
not a bug This is not a bug and it is working as intended.

Comments

@KaToRa192
Copy link

so I tried guildCreate event when a bot joins a server it should send a message. i tried it multiple times and it works once but when i tried another one it wont work anymore.

Screenshot_7

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Oct 26, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.76. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@Ayfri
Copy link
Member

Ayfri commented Oct 26, 2020

Show me your code.

@KaToRa192
Copy link
Author

@Ayfri Ayfri removed the bug Something isn't working label Oct 27, 2020
@Ayfri
Copy link
Member

Ayfri commented Oct 27, 2020

Do you have any errors?
Because you don't check if the bot can send a message nor the channel exists, so there are multiple cases where your code would fail.

@Ayfri Ayfri added the not a bug This is not a bug and it is working as intended. label Oct 27, 2020
@KaToRa192
Copy link
Author

there is no error i even tried using a simple bot handler it works fine with it

@Ayfri
Copy link
Member

Ayfri commented Oct 27, 2020

Oh strange, if you add a console.log (or something similar) after channel is declared, does it log every time?

@KaToRa192
Copy link
Author

KaToRa192 commented Oct 28, 2020

nvm i fixed it I jsut have to remove

client.on('guildCreate', guild => {

})

and added guild beside the async handler and it works fine now.

@Ayfri
Copy link
Member

Ayfri commented Oct 28, 2020

Oh yeah, I'm stupid, the handler makes sure that you don't need to put the client.on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug This is not a bug and it is working as intended.
Projects
None yet
Development

No branches or pull requests

2 participants