···11+# server
22+33+[](https://hex.pm/packages/server)
44+[](https://hexdocs.pm/server/)
55+66+```sh
77+gleam add server@1
88+```
99+```gleam
1010+import server
1111+1212+pub fn main() -> Nil {
1313+ // TODO: An example of the project in use
1414+}
1515+```
1616+1717+Further documentation can be found at <https://hexdocs.pm/server>.
1818+1919+## Development
2020+2121+```sh
2222+gleam run # Run the project
2323+gleam test # Run the tests
2424+```
+27
server/gleam.toml
···11+name = "server"
22+version = "1.0.0"
33+44+# Fill out these fields if you intend to generate HTML documentation or publish
55+# your project to the Hex package manager.
66+#
77+# description = ""
88+# licences = ["Apache-2.0"]
99+# repository = { type = "github", user = "", repo = "" }
1010+# links = [{ title = "Website", href = "" }]
1111+#
1212+# For a full reference of all the available options, you can have a look at
1313+# https://gleam.run/writing-gleam/gleam-toml/.
1414+1515+[dependencies]
1616+gleam_stdlib = ">= 0.44.0 and < 2.0.0"
1717+grom = { path = "../grom/"}
1818+logging = ">= 1.3.0 and < 2.0.0"
1919+envoy = ">= 1.1.0 and < 2.0.0"
2020+gleam_erlang = ">= 1.3.0 and < 2.0.0"
2121+pog = ">= 4.1.0 and < 5.0.0"
2222+splitter = ">= 1.2.0 and < 2.0.0"
2323+crew = ">= 2.0.0 and < 3.0.0"
2424+2525+[dev-dependencies]
2626+gleeunit = ">= 1.0.0 and < 2.0.0"
2727+squirrel = ">= 4.6.0 and < 5.0.0"
···11+-- creates reaction_roles table
22+--
33+create table if not exists reaction_roles (
44+ guild_id text not null,
55+ channel_id text not null,
66+ message_id text not null,
77+ emote text not null,
88+ target_role_id text not null
99+)
+8
server/src/server/reaction_role/sql/find.sql
···11+-- finds an entry using guild_id, channel_id and message_id
22+--
33+select
44+ *
55+from
66+ reaction_roles
77+where
88+ guild_id = $1 and channel_id = $2 and message_id = $3
+6
server/src/server/reaction_role/sql/insert.sql
···11+-- insert a new reaction_role record into the database
22+--
33+insert into reaction_roles
44+ (guild_id, channel_id, message_id, emote, target_role_id)
55+values
66+ ($1, $2, $3, $4, $5)
+13
server/test/server_test.gleam
···11+import gleeunit
22+33+pub fn main() -> Nil {
44+ gleeunit.main()
55+}
66+77+// gleeunit test functions end in `_test`
88+pub fn hello_world_test() {
99+ let name = "Joe"
1010+ let greeting = "Hello, " <> name <> "!"
1111+1212+ assert greeting == "Hello, Joe!"
1313+}