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

How can get channel name from MessageEvent? #102

Closed
eggcaker opened this issue Jun 13, 2022 · 1 comment
Closed

How can get channel name from MessageEvent? #102

eggcaker opened this issue Jun 13, 2022 · 1 comment
Assignees

Comments

@eggcaker
Copy link

How can get a channel name (#genenal like ) when received event? right now seems only channel id can read from even.

@arusso arusso self-assigned this Jun 28, 2022
@arusso
Copy link
Collaborator

arusso commented Jun 28, 2022

This will soon accessible directly from the MessageEvent struct once #100 is merged in, but for now you should be able to get it with something like this:

chan, _ := ctx.client.GetConversationInfo(ctx.Event().Channel)
// chan.Name should contain the name of the channel / dm you're in

@arusso arusso closed this as completed Jun 28, 2022
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

2 participants