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

feat: serenity integration #303

Merged
merged 8 commits into from
Aug 31, 2022
Merged

Conversation

oddgrd
Copy link
Contributor

@oddgrd oddgrd commented Aug 14, 2022

This PR implements Service for serenity::Client. This enable Discord bot-developers using Serenity to easily deploy bots with with or without databases. I've added two usage examples, a basic hello-world bot and a todo-list bot with shared::Postgres for persistence.

The integration works in it's current state with a valid token, but is a WIP as I am trying to figure out how to write tests for it. It's not straight-forward as the bot listens for commands via web-socket from Discord's servers. A valid discord token is also needed for the bot client to start.

Closes #281

@oddgrd oddgrd force-pushed the feat/serenity-integration branch from e4bba55 to 46bff1e Compare August 24, 2022 12:27
@kaleidawave
Copy link
Contributor

Looks great so far! Would also be good if we could get cargo shuttle init --serenity as well. Would make writing a bot super simple!

@oddgrd oddgrd force-pushed the feat/serenity-integration branch from 634c1c8 to 67aedb1 Compare August 24, 2022 19:32
Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is exciting @oddgrd!! Just some minor questions 😃

examples/serenity/hello_world/src/lib.rs Outdated Show resolved Hide resolved
examples/serenity/postgres/src/lib.rs Outdated Show resolved Hide resolved
examples/serenity/hello_world/src/lib.rs Outdated Show resolved Hide resolved
oddgrd added 7 commits August 29, 2022 12:55
 - implement Service for serenity::Client to deploy discord bots with shuttle

 - add hello-world and postgres examples
 - replace println's with tracing macros for logging

 - add readme for setting up and inviting bot in hello-world example
 - replace tracing macros with log macros

 - write readme for postgres example
@oddgrd oddgrd force-pushed the feat/serenity-integration branch from e5c7981 to f29b7a7 Compare August 29, 2022 11:05
@oddgrd oddgrd marked this pull request as ready for review August 29, 2022 11:09
@oddgrd oddgrd changed the title [WIP] feat: serenity integration feat: serenity integration Aug 29, 2022
@chesedo chesedo merged commit b333483 into shuttle-hq:main Aug 31, 2022
@oddgrd oddgrd deleted the feat/serenity-integration branch August 31, 2022 13:02
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

Successfully merging this pull request may close these issues.

Add serenity as a service for building Discord bots
3 participants