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

Output updates to channel #55

Open
djmcgill opened this issue Jan 27, 2020 · 1 comment
Open

Output updates to channel #55

djmcgill opened this issue Jan 27, 2020 · 1 comment

Comments

@djmcgill
Copy link
Owner

When a turn changes, either edit a pinned message, or just output into channel

@djmcgill
Copy link
Owner Author

djmcgill commented Apr 16, 2022

So the code that you want is in src/commands/servers/turn_check.rs, specifically the method create_messages_for_new_turn, which is the code that DMs all the players and should probably be the code that DMs the channel too.

You probably would get the list of channels, each time a game gets a new turn, using
https://docs.rs/serenity/latest/serenity/cache/struct.Cache.html#method.guild_channels
and the current guild with

// `src/slash_commands.rs`
    let guilds = http // (or `cache`)
        // The bot is only ever in one server per instance, so yolo
        .get_guilds(&GuildPagination::After(GuildId(0)), 1)
        .await?;

and get the http from its parent function update_details_cache_loop. These should all be cached via the HttpAndCache serenity thing so I'm not worried about performance or whatever and it makes it resilient to channel renames and also you don't have to persist any channel IDs in the db or whatever.

idk if it should be automatic, or a toggle, or opt-in, or what. A toggle means you suddenly got to care about the db stuff. But no toggle means idk somebody can spam you or something?

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

No branches or pull requests

1 participant