├── .cargo
└── config.toml
├── .dockerignore
├── .env.example
├── .github
└── workflows
│ ├── binary.yml
│ ├── dockerfile.yml
│ └── linters.yml
├── .gitignore
├── .python-version
├── .sqlx
├── query-00668fa18ca090b0a5478725b43404d8d3be40005ef4327b52135b4fd51eef44.json
├── query-00785ad758eb025ae58825e7337215ce42a9f1295be1ade608a5dca8e1cba1db.json
├── query-07b363d149ec563f4dbb48155cfbaf6bea5b11f72f773ff088a6cc11ab9e0fba.json
├── query-11fd4f50cfb79809d07429d7f28a2393ff8d181da61abc682895601e968c5655.json
├── query-13b1e5d17c14aac48d3a7d931a658d68e88405b1ac8ea7c761243755a955290b.json
├── query-1650fe04a458b90240649a530f67ce2849b7df9b9da49b85f8d3b53bddfb7da5.json
├── query-1c612dbf7d2c8b0c54bd74178eedaf27161231fd39c77e1166247cfe20f47694.json
├── query-1e97a4efe59b3243df8529421c4c1227f4a232c43c1e478aafd448c250ffa3a2.json
├── query-1edc3c2d8f00fee9397aeeab97cb799269d8b31fc82b27c1c81dd2a14c8f7a9b.json
├── query-22768a2f355a842e9f609a897425324de4c212c1eec688ca5a75708f764635ac.json
├── query-232d3431ed72c399490e35240a043e21089d344c4628eff00d33afad3cd1984b.json
├── query-25599ea197f5c6204f94aad86f77e79a5e81089883bc9af1c618a3db0e0d128b.json
├── query-25845c5698c7cdc6647af1b63e60455459f53981689429062f556cd356af4cd7.json
├── query-26876cce9d0bf60e05178f227423ee522648b2204457ff7a73fec4e87311bfdf.json
├── query-28df5cecf132f47eb3eb18cada4c08d0c44f863c691939fdc19eb0e2f9edd016.json
├── query-2908c451e2f179410b4eb54ae6e9027d311a4a0528705043993f18179599f29c.json
├── query-2a6d0bd9e502f359d5b3b15298e1caf8d378e9a5eb8cbf44e4033192e5251642.json
├── query-2d2cb73ba3afc97d626f14bfe088d7d35359331378d0b93cf58aca1318ee5fb9.json
├── query-2de65310d2d027b37d33d3862ee993c46cd5bff71059298bb8e73b672fe48d77.json
├── query-305ccf668cafb08dbc693909679a3fecea341b96ae8fd79d155d8981d7b38bc0.json
├── query-34313c87878e50cc7949cc3894b66af169e83820e3fa61bb8f3a6a49f9c1fc01.json
├── query-343e3787a742ae6ed8bcb167d2a5ebe8ccd6b29a5d52eca4cb4382391eca39f8.json
├── query-35ae6e890e43bd712a5fcbab383cf0f84b295784587d25301f8d23dbce6a3524.json
├── query-36531a7bbb599e7cb5023020373f126f5d892211e8a28122c24f1f6a5bddfba0.json
├── query-3bbdfb879d54c4721345f459ac595463c856c8506235e89cc90e334682f50913.json
├── query-3eeba2e6b37d8c469dedecded74692bc5933621ebbeff3397f6dab98402209ed.json
├── query-41bc5b9e1b49822c841bf923b635efa85b610aa16a603c7abaf6908e89e1d231.json
├── query-44e187a92daa9453a5465cd057fdeaa7237eb96c13395d7d099b714d85793eff.json
├── query-4960a52935c26aa885840fd942467a65297d10321ae6424781b2ee3ffa4f0875.json
├── query-4b41f197184d8aaa3c397617f4111eb3f77db7015bf9b75693fffd1207e9a00f.json
├── query-4e13af608f227e4690755f01dead21bed002225d12237cf75c3bc6e80906fcbe.json
├── query-5369c8101c779a94d469be24ab5e593f29247d7cc8ad92f39f971d0dc223f875.json
├── query-597e1b1256bc783fb85af110b378fcdd652b9b0314d5d2f3d6a18aa42a6f1592.json
├── query-5b5a0c282654e3770655e69f6aa80d54ad9dc492f19ca81fc779b2a21a3ef5d2.json
├── query-5d29e7b84d7f07dbae3aa1050e29f8118590a1f14c6cff076d89b14fd2e17247.json
├── query-5e3245cf2ff5bbcc8443a0237fcc5a50d558e6c15313fb33595b49e65477570a.json
├── query-5f535bd03724f832cb2c4ad0e5204ef633b789fa8443a5c9d1a9029a4576ac03.json
├── query-6368dd70667549f0c0b0b9bf33cce5a62eadc15ffd0ea4fb5437a995a153deb0.json
├── query-705f7b60be453ee60099070b5fc5788991e34209f8c0e52f05ed562a7eb52766.json
├── query-73b99d629e0672d4a609f37bf4ed07ca8164cc4e3d80b0bbaa35dc73d8002d36.json
├── query-7aa75622d12ee64a87a749e930bfa042f5e7f770d6eb42938fe6ca4397fdc268.json
├── query-7fa4c774189522476a72220b95c4001f89547189eb2aed97067b2688049e8dbf.json
├── query-8079d6b95d5eed89a7ce43e14a25bf9331357013f2f0a9dfbe477916cd22f18d.json
├── query-81c8b76554d6304dea692ac6d7bb95db6b95f381881f7ccdd85d310087e9a46a.json
├── query-82c04e99eefafa6df9e39ae70f4de81f7c0d9d5325cb8baa53f08c477c70acdf.json
├── query-85c6d9a2308e670def0903647e7b2f1f41ab934e742b828e839698aea8dfa891.json
├── query-8ad4efd6021caa4fddc8a622623dd02864162e8ae7d0f2d45600a7d0aadaa1fb.json
├── query-8fdff3b23bf87171d6501c2f7a9a66db50f4f9adeb5f0130b415f08f2e30c310.json
├── query-9218ad57bf0ef416cd2b700e771fe38924e159ecdc833a99cd716c772e31be34.json
├── query-a2abf8a0f150945b1b627443345b17ca90067b1fdc085602e205292f09731457.json
├── query-a55baeff8a9d29d3f4bf93bdce5a8516107f98b21ef7eaf913e1d73cafbad1a1.json
├── query-a61af56279669945475e1bd6c07314ddcc6b8dd48641b187bcf3f92516b680e0.json
├── query-a70c68916ccaa238c333c30cc7aad03bc9dd4d6045e8701b20c0b184ef43d855.json
├── query-a79cb39778f193bc5d0f987f046f32e9c5558510474cced79325769001f0ae68.json
├── query-a87cecbf5594813de9ae09f64bf587c1351b38780227baedb26c86422e2bdaa6.json
├── query-a90b58705c2aa90bd947676b09f5c1bd7cf8de9ac78a57ae007ba1e233e23ff5.json
├── query-ab63ab3a8a49e4c632a3e8c65b352f129d1b8cf94214bc9cb993084615a7c16f.json
├── query-b16a45673e483ada9bfe1a8abbb87d4a340ead03b9eabe78831c57260f4e5c1b.json
├── query-b6c6c3af88d80513ae83e8f6423b54f0eb8b7344a765f5205b2ae35347e0ee00.json
├── query-bf767562a1fcd3e989d5d7800f8feb19959cb78d9d68850bd4d18bf3f5d6855f.json
├── query-bfca9396251c01fbf9510069699b07a287ac149e0598f5056d25b8582481a44d.json
├── query-c582ba49e685230ff575ffeb988d5e400b32202ccdad7f1394ae0a4f534bebd4.json
├── query-c59f56d07fec4f68c5c8640e55d12d91d21841bc52f977418f0ac2ca44f95da4.json
├── query-d18d09060c52e884da8d3118a9506589b1c597eae4e9f1294758cf97513a0655.json
├── query-d61f09ce4f51ba7952643cb0f3a73b0e82ad46fffcbee1c80097bf5d4999ba56.json
├── query-d87f633a372b2d8a6b22cd2f472d6ede1dad106dc17122e9bc1ee4c6aeda1003.json
├── query-d95a944ff53eac4be1375577edabda691086a1475563fbb23c80128f44fc0ede.json
├── query-da69ed66364b8d8e5d0a70a8e789a1bfffa6fe7e7d1380ebe6547f485421a7e0.json
├── query-da83b806c17fe16468b9c70136eaf3ded1d1079761919c7a9f2c9f8b53e72f0d.json
├── query-dfa520877c017cd5808d02c24ef2d71938b68093974f335a4d89df91874fdaa2.json
├── query-e12aad9daf3df4c789502c6b54d770f6f4141273f107981255b36b67ffd131b3.json
├── query-e1758cf7ba1424941e3c07f12c0b28f338781ab348743979c57d8a8e8336a9b7.json
├── query-e20129046ffbefeacec498611c65ecaa944eae3ca76f87b02c93118aa663791b.json
├── query-eb1135121d7f409c041eff3645dec66471e99d4cc0c0e689fe137bad90ee70f0.json
├── query-ebb2c791e92fec2e5b8f0ccbf10b9e0da345e40a2054c74652c4eb7842f88ed5.json
├── query-ed9c186510d2e3d31b1634a1db068e786996dcb6c0dc741dc207df9f73ce4b7a.json
├── query-f1127d19808b04e64dbb74fddccd72146bb25d96661bf4ce473d0be6fddcbd23.json
├── query-f2b76182252d68d938737226b537ddff4930ff59af6dd60bfbb15e11236cdfdb.json
├── query-f2f065836ccd89c512070fad43b04c5e0a842c6cb7ba09dac4439239db761f74.json
├── query-f3edc5bc2652e4dd2e9ea1bf9dcdeb7a98fe957e4898da60413c356dd82e7c29.json
├── query-f4a7c95fdaba6a38ffe1bd3177687ff90e52c8592310914c876d668e8dd30ec1.json
├── query-f89f8a631ebf9bd1c26cfff8d7323ac758f64807e49c9e3179979efb78875c71.json
├── query-fa9bd7bdaa7ecd515b79993101eacfb3c3b0394fc7e6a75c5bec43c239a9ef90.json
├── query-fd57884a830694a5fc149d1ef72983eb444c0c15371e8771e0136ca848afa105.json
└── query-fe0b5b46dc49b47641b4c7811fc7bdf7966bad815cbf02d6f3c2e5721445f256.json
├── .weblate
├── Cargo.lock
├── Cargo.toml
├── Dockerfile
├── LICENSE
├── README.md
├── config.example.toml
├── deny.toml
├── doc
├── selfhosting-from-source.md
├── selfhosting-podman.md
└── selfhosting-prebuilt.md
├── migrations
├── 20220205060135_initial_migration.sql
├── 20220206034602_blocked_entities.sql
├── 20220208005540_convert_to_not_null.sql
├── 20220213083816_more_user_fields.sql
├── 20220323050213_add_user_language.sql
├── 20220324042751_change_user_language_column_type.sql
├── 20220324044030_change_defaults.sql
├── 20220326005718_message_and_audio_storage.sql
├── 20220422014155_convert_userids_to_hashed.sql
├── 20220619210730_default_for_audio_store_ID.sql
├── 20220707194906_remove_author_id_and_message_id_from_message_store.sql
├── 20220707232119_switch_type_of_message_content.sql
├── 20220707232647_not_null_message_content.sql
├── 20220708045546_save_nonce_with_message_content.sql
├── 20220801052859_alter_premium_layout.sql
├── 20220801061346_add_is_trialing_to_user.sql
├── 20220801063251_add_timezone_to_timestamps_because_sqlx_doesn't_support_without.sql
├── 20220801222122_add_timezone_to_timestamps_pt_2.sql
├── 20220824213251_remove_channels_table.sql
├── 20221122161618_automod_tables.sql
├── 20221124000934_add_unique_constraint_for_automod.sql
├── 20221127221641_fix_table_types.sql
├── 20230607172816_voice_message_enable.sql
├── 20230814023409_remove_target_channel_and_add_agreed_tos.sql
├── 20231014010314_guild_all_audio_file_transcription.sql
├── 20231014175034_guild_all_video_file_transcription.sql
├── 20231129024221_guild_auto_detect_lang.sql
├── 20231202032922_guild_transcript_only_role_members.sql
├── 20231211021825_translate_to_english.sql
├── 20231211023309_translate_to_english_enabled_by_default.sql
├── 20231216214434_vote_reminder_table.sql
├── 20231217034034_vote_reminder_opt_out.sql
├── 20231229163655_vote_reminder_enabled.sql
├── 20240115205731_kiai_integration_enabled.sql
├── 20240415174617_remove_tos_agree.sql
├── 20240920165244_default_translate_to_false.sql
├── 20250119180948_add_default_command_parameter_options.sql
├── 20250222001334_move_auto_join_to_config.sql
├── 20250302041748_fix_fkey_relations.sql
├── 20250302043001_move_prefixes_into_guilds_table.sql
├── 20250525065734_per_voice_channel_target_channel.sql
└── 20250526220035_per_voice_channel_auto_join_settings.sql
├── prometheus.yml
├── rust-toolchain.toml
├── rustfmt.toml
├── scripty_audio_handler
├── Cargo.toml
└── src
│ ├── audio_handler.rs
│ ├── connect.rs
│ ├── consts.rs
│ ├── disconnect.rs
│ ├── events
│ ├── client_disconnect.rs
│ ├── driver_connect.rs
│ ├── driver_disconnect.rs
│ ├── mod.rs
│ ├── rtp_packet.rs
│ ├── speaking_state_update.rs
│ └── voice_tick.rs
│ ├── lib.rs
│ └── types.rs
├── scripty_automod
├── Cargo.toml
└── src
│ ├── db.rs
│ ├── lib.rs
│ ├── types.rs
│ └── utils.rs
├── scripty_bot
├── Cargo.toml
└── src
│ ├── framework_opts.rs
│ └── lib.rs
├── scripty_bot_utils
├── Cargo.toml
└── src
│ ├── available_language_autocomplete.rs
│ ├── background_tasks
│ ├── core.rs
│ ├── mod.rs
│ └── tasks
│ │ ├── basic_stats_update.rs
│ │ ├── bot_list_poster.rs
│ │ ├── bot_vote_reminder.rs
│ │ ├── cmd_latency_clear.rs
│ │ ├── mod.rs
│ │ ├── prometheus_latency_update.rs
│ │ └── status_update.rs
│ ├── dm_support.rs
│ ├── entity_block.rs
│ ├── error
│ ├── error_type.rs
│ ├── handler.rs
│ ├── message.rs
│ └── mod.rs
│ ├── extern_utils.rs
│ ├── file_transcripts
│ ├── consts.rs
│ ├── handler.rs
│ ├── message_updater.rs
│ ├── mod.rs
│ ├── raw_pcm_conversions.rs
│ └── state.rs
│ ├── globals.rs
│ ├── handler
│ ├── mod.rs
│ ├── normal
│ │ ├── cache.rs
│ │ ├── message.rs
│ │ ├── mod.rs
│ │ ├── ready.rs
│ │ ├── resume.rs
│ │ ├── shards.rs
│ │ └── voice_state_update.rs
│ ├── post_command.rs
│ ├── pre_command.rs
│ ├── ratelimit.rs
│ └── raw
│ │ └── mod.rs
│ ├── lib.rs
│ ├── prefix_handling.rs
│ └── types
│ ├── ctx.rs
│ ├── invocation_data.rs
│ ├── lang.rs
│ └── mod.rs
├── scripty_botlists
├── Cargo.toml
└── src
│ ├── common.rs
│ ├── lib.rs
│ ├── lists
│ ├── botlist_me
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── discord_bots_gg
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── discordbotlist_com
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── discordextremelist_xyz
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── discords_com
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── discordservices_net
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── disforge_com
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── infinitybots_gg
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── mod.rs
│ ├── top_gg
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ ├── voidbots_net
│ │ ├── mod.rs
│ │ ├── models.rs
│ │ └── trait_impl.rs
│ └── wumpus_store
│ │ ├── mod.rs
│ │ └── models.rs
│ └── post_stats.http
├── scripty_build_checks
├── Cargo.toml
└── src
│ └── lib.rs
├── scripty_commands
├── Cargo.toml
├── src
│ ├── cmds
│ │ ├── admin
│ │ │ ├── cache_info.rs
│ │ │ ├── guild_check.rs
│ │ │ ├── hash_user_id.rs
│ │ │ ├── mod.rs
│ │ │ └── shutdown.rs
│ │ ├── automod
│ │ │ ├── add_rule.rs
│ │ │ ├── list_rules.rs
│ │ │ ├── mod.rs
│ │ │ ├── remove_rule.rs
│ │ │ └── setup.rs
│ │ ├── config
│ │ │ ├── auto_detect_lang.rs
│ │ │ ├── auto_join.rs
│ │ │ ├── default_settings
│ │ │ │ ├── ephemeral.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── new_thread.rs
│ │ │ │ ├── record_transcriptions.rs
│ │ │ │ └── target_channel.rs
│ │ │ ├── kiai_enabled.rs
│ │ │ ├── language.rs
│ │ │ ├── mod.rs
│ │ │ ├── prefix.rs
│ │ │ ├── transcribe_audio.rs
│ │ │ ├── transcribe_only_role.rs
│ │ │ ├── transcribe_video.rs
│ │ │ ├── transcribe_voice_messages.rs
│ │ │ ├── translate.rs
│ │ │ └── verbose.rs
│ │ ├── data_storage.rs
│ │ ├── debug.rs
│ │ ├── dm_support.rs
│ │ ├── entity_block.rs
│ │ ├── help.rs
│ │ ├── join.rs
│ │ ├── language.rs
│ │ ├── leave.rs
│ │ ├── mod.rs
│ │ ├── ping.rs
│ │ ├── premium
│ │ │ ├── claim.rs
│ │ │ ├── info.rs
│ │ │ ├── mod.rs
│ │ │ └── remove.rs
│ │ ├── register_cmds.rs
│ │ ├── throw_error.rs
│ │ ├── transcribe_message.rs
│ │ └── vote_reminders.rs
│ ├── i18n.rs
│ └── lib.rs
└── target
│ └── sqlx
│ └── scripty_commands
│ └── query-d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.json
├── scripty_config
├── Cargo.toml
└── src
│ ├── cfg.rs
│ ├── lib.rs
│ └── load.rs
├── scripty_core
├── Cargo.toml
└── src
│ └── main.rs
├── scripty_data_storage
├── Cargo.toml
└── src
│ ├── cache
│ ├── mod.rs
│ ├── text.rs
│ └── voice.rs
│ ├── crypto.rs
│ ├── ingest
│ ├── mod.rs
│ ├── text.rs
│ └── voice.rs
│ ├── lib.rs
│ └── main.rs
├── scripty_data_type
├── Cargo.toml
└── src
│ ├── call_death_struct.rs
│ └── lib.rs
├── scripty_db
├── Cargo.toml
└── src
│ ├── init.rs
│ ├── lib.rs
│ └── store.rs
├── scripty_error
├── Cargo.toml
└── src
│ ├── ffprobe.rs
│ ├── file_transcript.rs
│ ├── global.rs
│ ├── internal.rs
│ ├── lib.rs
│ └── model.rs
├── scripty_i18n
├── Cargo.toml
├── locales
│ ├── af.ftl
│ ├── ar.ftl
│ ├── be.ftl
│ ├── bg.ftl
│ ├── ca.ftl
│ ├── codes.json
│ ├── cs.ftl
│ ├── cy.ftl
│ ├── da.ftl
│ ├── de.ftl
│ ├── el.ftl
│ ├── en.ftl
│ ├── en@uwu.ftl
│ ├── en_devel.ftl
│ ├── es.ftl
│ ├── et.ftl
│ ├── fa.ftl
│ ├── fi.ftl
│ ├── fr.ftl
│ ├── gl.ftl
│ ├── he.ftl
│ ├── hi.ftl
│ ├── hr.ftl
│ ├── hu.ftl
│ ├── hy.ftl
│ ├── id.ftl
│ ├── is.ftl
│ ├── it.ftl
│ ├── ja.ftl
│ ├── kk.ftl
│ ├── kn.ftl
│ ├── ko.ftl
│ ├── la.ftl
│ ├── lt.ftl
│ ├── lv.ftl
│ ├── mi.ftl
│ ├── mk.ftl
│ ├── mr.ftl
│ ├── ms.ftl
│ ├── nb_NO.ftl
│ ├── ne.ftl
│ ├── nl.ftl
│ ├── pl.ftl
│ ├── pt.ftl
│ ├── pt_BR.ftl
│ ├── ro.ftl
│ ├── ru.ftl
│ ├── sk.ftl
│ ├── sl.ftl
│ ├── sr.ftl
│ ├── sv.ftl
│ ├── sw.ftl
│ ├── ta.ftl
│ ├── th.ftl
│ ├── tl.ftl
│ ├── tr.ftl
│ ├── uk.ftl
│ ├── ur.ftl
│ ├── vi.ftl
│ ├── zh_Hans.ftl
│ └── zh_Hant.ftl
└── src
│ ├── bundles.rs
│ ├── cache.rs
│ ├── init.rs
│ ├── lib.rs
│ ├── main.rs
│ ├── pretty.rs
│ ├── store.rs
│ └── strings.rs
├── scripty_integrations
├── Cargo.toml
└── src
│ ├── kiai
│ ├── api_models.rs
│ ├── error.rs
│ ├── http_client.rs
│ └── mod.rs
│ └── lib.rs
├── scripty_metrics
├── Cargo.toml
└── src
│ ├── cmd_handler.rs
│ ├── cmd_latency.rs
│ ├── get_metrics.rs
│ ├── lib.rs
│ ├── metrics.rs
│ └── rt_metrics.rs
├── scripty_premium
├── Cargo.toml
└── src
│ └── lib.rs
├── scripty_redis
├── Cargo.toml
└── src
│ ├── init.rs
│ ├── lib.rs
│ └── transaction.rs
├── scripty_stt
├── Cargo.toml
└── src
│ ├── decode_ogg_opus.rs
│ ├── ffprobe.rs
│ ├── init.rs
│ ├── lib.rs
│ ├── load_balancer.rs
│ ├── models.rs
│ └── process_audio.rs
├── scripty_tts
├── Cargo.toml
└── src
│ ├── engine_trait.rs
│ ├── lib.rs
│ └── tts_engines
│ ├── espeak_ng.rs
│ └── mod.rs
├── scripty_utils
├── Cargo.toml
└── src
│ ├── embed_pagination.rs
│ ├── hash_user_id.rs
│ ├── latency
│ ├── db.rs
│ ├── http.rs
│ ├── mod.rs
│ └── ws.rs
│ ├── lib.rs
│ └── separate_num.rs
├── scripty_webserver
├── Cargo.toml
└── src
│ ├── auth.rs
│ ├── endpoints
│ ├── bot_stats
│ │ ├── advanced.rs
│ │ └── mod.rs
│ ├── languages.rs
│ ├── metrics.rs
│ ├── mod.rs
│ ├── premium
│ │ └── mod.rs
│ └── webhooks
│ │ ├── discordservices_net.rs
│ │ ├── mod.rs
│ │ ├── top_gg.rs
│ │ └── wumpus_store.rs
│ ├── entrypoint.rs
│ ├── errors.rs
│ ├── lib.rs
│ └── models.rs
└── speech_commands.md
/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [target.x86_64-unknown-linux-gnu]
2 | linker = "clang"
3 | rustflags = ["-Ctarget-cpu=native", "--cfg", "tokio_unstable", "-C", "link-arg=-fuse-ld=mold", "-Zshare-generics=y"]
4 |
5 | [build]
6 | rustdocflags = ["--cfg", "tokio_unstable"]
7 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | /.github
2 | /target
3 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # format postgresql://username[:password]@host/db_name
2 | DATABASE_URL=postgresql://scripty:scripty@localhost/scripty
3 |
--------------------------------------------------------------------------------
/.github/workflows/binary.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | paths-ignore:
4 | - "**.md"
5 | - "**.ftl"
6 | branches:
7 | - master
8 |
9 | env:
10 | CARGO_TERM_COLOR: always
11 | CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
12 | RUSTFLAGS: "--cfg tokio_unstable -Clink-arg=-fuse-ld=mold -Zshare-generics=y"
13 |
14 | name: Build executable
15 |
16 | jobs:
17 | build:
18 | name: Build binary
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v4
22 | - uses: rui314/setup-mold@v1
23 | - uses: actions-rust-lang/setup-rust-toolchain@v1
24 | with:
25 | target: x86_64-unknown-linux-gnu
26 | toolchain: nightly
27 |
28 | - name: Build
29 | run: cargo build --release --target x86_64-unknown-linux-gnu
30 |
31 | - name: Upload artifact
32 | uses: actions/upload-artifact@v4
33 | with:
34 | name: scripty_v2-x86_64-unknown-linux-gnu
35 | path: target/x86_64-unknown-linux-gnu/release/scripty_v2
36 |
--------------------------------------------------------------------------------
/.github/workflows/dockerfile.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | paths-ignore:
4 | - "**.md"
5 | - "**.ftl"
6 | branches:
7 | - master
8 |
9 | env:
10 | REGISTRY: ghcr.io
11 | IMAGE_NAME: ${{ github.repository }}
12 |
13 | name: Build Docker image
14 |
15 | jobs:
16 | build:
17 | runs-on: ubuntu-22.04
18 |
19 | permissions:
20 | contents: read
21 | packages: write
22 | attestations: write
23 | id-token: write
24 |
25 | steps:
26 | - uses: actions/checkout@v4
27 |
28 | - name: Log in to the Container registry
29 | uses: docker/login-action@v3.4.0
30 | with:
31 | registry: ${{ env.REGISTRY }}
32 | username: ${{ github.actor }}
33 | password: ${{ secrets.GITHUB_TOKEN }}
34 |
35 | - name: Extract metadata (tags, labels) for Docker
36 | id: meta
37 | uses: docker/metadata-action@v5.7.0
38 | with:
39 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40 |
41 | - name: Build and push Docker image
42 | id: push
43 | uses: docker/build-push-action@v6.15.0
44 | with:
45 | context: .
46 | push: true
47 | tags: ${{ steps.meta.outputs.tags }}
48 | labels: ${{ steps.meta.outputs.labels }}
49 |
50 | - name: Generate artifact attestation
51 | uses: actions/attest-build-provenance@v2.2.3
52 | with:
53 | subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
54 | subject-digest: ${{ steps.push.outputs.digest }}
55 | push-to-registry: true
56 |
--------------------------------------------------------------------------------
/.github/workflows/linters.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | paths-ignore:
4 | - "**.md"
5 | - "**.ftl"
6 | branches:
7 | - master
8 |
9 | name: Lint code
10 | env:
11 | RUSTFLAGS: "--cfg tokio_unstable"
12 |
13 | jobs:
14 | fmt:
15 | name: Rustfmt
16 | runs-on: ubuntu-latest
17 | steps:
18 | - uses: actions/checkout@v2
19 |
20 | - uses: actions-rust-lang/setup-rust-toolchain@v1
21 | with:
22 | components: rustfmt
23 | toolchain: nightly
24 | override: true
25 |
26 | - uses: actions-rs/cargo@v1
27 | with:
28 | command: fmt
29 | args: -- --check
30 |
31 | clippy:
32 | name: Clippy
33 | runs-on: ubuntu-latest
34 | steps:
35 | - uses: actions/checkout@v2
36 | - uses: rui314/setup-mold@v1
37 | - uses: actions-rust-lang/setup-rust-toolchain@v1
38 | with:
39 | toolchain: nightly
40 | components: clippy
41 | override: true
42 |
43 | - run: cargo clippy
44 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/target
2 | /.env
3 | /.idea
4 | /.vscode
5 | /config.toml
6 | /config.local.toml
7 | /config.dev.toml
8 | /output.log
9 | # not ignored by **/target for some reason
10 | scripty_commands/target/*
11 | fetch-voice-message.http
12 | scripty_botlists/src/http-client.private.env.json
--------------------------------------------------------------------------------
/.python-version:
--------------------------------------------------------------------------------
1 | 3.9.17
2 |
--------------------------------------------------------------------------------
/.sqlx/query-00668fa18ca090b0a5478725b43404d8d3be40005ef4327b52135b4fd51eef44.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT store_audio FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "store_audio",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "00668fa18ca090b0a5478725b43404d8d3be40005ef4327b52135b4fd51eef44"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-00785ad758eb025ae58825e7337215ce42a9f1295be1ade608a5dca8e1cba1db.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO blocked_users (user_id, reason, blocked_since) VALUES ($1, $2, localtimestamp)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Text"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "00785ad758eb025ae58825e7337215ce42a9f1295be1ade608a5dca8e1cba1db"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-07b363d149ec563f4dbb48155cfbaf6bea5b11f72f773ff088a6cc11ab9e0fba.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET store_msgs = NOT store_msgs WHERE user_id = $1 RETURNING store_msgs",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "store_msgs",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "07b363d149ec563f4dbb48155cfbaf6bea5b11f72f773ff088a6cc11ab9e0fba"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-11fd4f50cfb79809d07429d7f28a2393ff8d181da61abc682895601e968c5655.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT * FROM automod_rules WHERE source_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "source_id",
14 | "type_info": "Int4"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "rule_type",
19 | "type_info": "Int2"
20 | },
21 | {
22 | "ordinal": 3,
23 | "name": "rule_data",
24 | "type_info": "Text"
25 | },
26 | {
27 | "ordinal": 4,
28 | "name": "rule_action",
29 | "type_info": "Int2"
30 | }
31 | ],
32 | "parameters": {
33 | "Left": [
34 | "Int4"
35 | ]
36 | },
37 | "nullable": [
38 | false,
39 | false,
40 | false,
41 | false,
42 | false
43 | ]
44 | },
45 | "hash": "11fd4f50cfb79809d07429d7f28a2393ff8d181da61abc682895601e968c5655"
46 | }
47 |
--------------------------------------------------------------------------------
/.sqlx/query-13b1e5d17c14aac48d3a7d931a658d68e88405b1ac8ea7c761243755a955290b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "DELETE FROM automod_rules WHERE source_id = $1 AND item_id = $2 RETURNING item_id",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int4",
15 | "Int4"
16 | ]
17 | },
18 | "nullable": [
19 | false
20 | ]
21 | },
22 | "hash": "13b1e5d17c14aac48d3a7d931a658d68e88405b1ac8ea7c761243755a955290b"
23 | }
24 |
--------------------------------------------------------------------------------
/.sqlx/query-1650fe04a458b90240649a530f67ce2849b7df9b9da49b85f8d3b53bddfb7da5.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO automod_config \n (guild_id, enabled, log_channel_id, log_recording)\n VALUES \n ($1, true, $2, $3)\n\t\tON CONFLICT (guild_id) DO UPDATE SET\n\t\t\tlog_channel_id = $2,\n\t\t\tlog_recording = $3\n ",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Int8",
10 | "Bool"
11 | ]
12 | },
13 | "nullable": []
14 | },
15 | "hash": "1650fe04a458b90240649a530f67ce2849b7df9b9da49b85f8d3b53bddfb7da5"
16 | }
17 |
--------------------------------------------------------------------------------
/.sqlx/query-1c612dbf7d2c8b0c54bd74178eedaf27161231fd39c77e1166247cfe20f47694.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, transcribe_audio_files) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET transcribe_audio_files = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "1c612dbf7d2c8b0c54bd74178eedaf27161231fd39c77e1166247cfe20f47694"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-1e97a4efe59b3243df8529421c4c1227f4a232c43c1e478aafd448c250ffa3a2.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry)\nVALUES\n ($1, 1, now() + INTERVAL '1 day')\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = 1,\n premium_expiry = now() + INTERVAL '1 day'\n",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "1e97a4efe59b3243df8529421c4c1227f4a232c43c1e478aafd448c250ffa3a2"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-1edc3c2d8f00fee9397aeeab97cb799269d8b31fc82b27c1c81dd2a14c8f7a9b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT target_channel AS \"target_channel!\"\n\t\t\t\t\tFROM default_join_settings\n\t\t\t\t\tWHERE guild_id = $1 AND target_channel IS NOT NULL",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "target_channel!",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "1edc3c2d8f00fee9397aeeab97cb799269d8b31fc82b27c1c81dd2a14c8f7a9b"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-22768a2f355a842e9f609a897425324de4c212c1eec688ca5a75708f764635ac.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT auto_join_enabled, target_channel\n\t\t\tFROM per_voice_channel_settings\n\t\t\tWHERE channel_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "auto_join_enabled",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "target_channel",
14 | "type_info": "Int8"
15 | }
16 | ],
17 | "parameters": {
18 | "Left": [
19 | "Int8"
20 | ]
21 | },
22 | "nullable": [
23 | false,
24 | true
25 | ]
26 | },
27 | "hash": "22768a2f355a842e9f609a897425324de4c212c1eec688ca5a75708f764635ac"
28 | }
29 |
--------------------------------------------------------------------------------
/.sqlx/query-232d3431ed72c399490e35240a043e21089d344c4628eff00d33afad3cd1984b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry, is_trialing)\nVALUES\n ($1, $2, $3, false)\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = $2,\n premium_expiry = $3,\n is_trialing = false\n",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Int2",
10 | "Timestamptz"
11 | ]
12 | },
13 | "nullable": []
14 | },
15 | "hash": "232d3431ed72c399490e35240a043e21089d344c4628eff00d33afad3cd1984b"
16 | }
17 |
--------------------------------------------------------------------------------
/.sqlx/query-25599ea197f5c6204f94aad86f77e79a5e81089883bc9af1c618a3db0e0d128b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, transcribe_video_files) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET transcribe_video_files = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "25599ea197f5c6204f94aad86f77e79a5e81089883bc9af1c618a3db0e0d128b"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-25845c5698c7cdc6647af1b63e60455459f53981689429062f556cd356af4cd7.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT reason FROM blocked_guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "reason",
9 | "type_info": "Text"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "25845c5698c7cdc6647af1b63e60455459f53981689429062f556cd356af4cd7"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-26876cce9d0bf60e05178f227423ee522648b2204457ff7a73fec4e87311bfdf.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT transcribe_audio_files, transcribe_video_files, transcribe_voice_messages FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "transcribe_audio_files",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "transcribe_video_files",
14 | "type_info": "Bool"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "transcribe_voice_messages",
19 | "type_info": "Bool"
20 | }
21 | ],
22 | "parameters": {
23 | "Left": [
24 | "Int8"
25 | ]
26 | },
27 | "nullable": [
28 | false,
29 | false,
30 | false
31 | ]
32 | },
33 | "hash": "26876cce9d0bf60e05178f227423ee522648b2204457ff7a73fec4e87311bfdf"
34 | }
35 |
--------------------------------------------------------------------------------
/.sqlx/query-28df5cecf132f47eb3eb18cada4c08d0c44f863c691939fdc19eb0e2f9edd016.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET store_msgs = $1 WHERE user_id = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bool",
9 | "Bytea"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "28df5cecf132f47eb3eb18cada4c08d0c44f863c691939fdc19eb0e2f9edd016"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-2908c451e2f179410b4eb54ae6e9027d311a4a0528705043993f18179599f29c.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO message_store (message_content, nonce) VALUES ($1, $2)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Bytea"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "2908c451e2f179410b4eb54ae6e9027d311a4a0528705043993f18179599f29c"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-2a6d0bd9e502f359d5b3b15298e1caf8d378e9a5eb8cbf44e4033192e5251642.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE guilds SET premium_owner_id = nullif(premium_owner_id, $2) WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bytea"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "2a6d0bd9e502f359d5b3b15298e1caf8d378e9a5eb8cbf44e4033192e5251642"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-2d2cb73ba3afc97d626f14bfe088d7d35359331378d0b93cf58aca1318ee5fb9.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT * FROM automod_config WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "guild_id",
14 | "type_info": "Int8"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "enabled",
19 | "type_info": "Bool"
20 | },
21 | {
22 | "ordinal": 3,
23 | "name": "log_channel_id",
24 | "type_info": "Int8"
25 | },
26 | {
27 | "ordinal": 4,
28 | "name": "log_recording",
29 | "type_info": "Bool"
30 | }
31 | ],
32 | "parameters": {
33 | "Left": [
34 | "Int8"
35 | ]
36 | },
37 | "nullable": [
38 | false,
39 | false,
40 | false,
41 | false,
42 | false
43 | ]
44 | },
45 | "hash": "2d2cb73ba3afc97d626f14bfe088d7d35359331378d0b93cf58aca1318ee5fb9"
46 | }
47 |
--------------------------------------------------------------------------------
/.sqlx/query-2de65310d2d027b37d33d3862ee993c46cd5bff71059298bb8e73b672fe48d77.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT trial_used, premium_owner_id IS NULL AS \"premium_owner_id_is_null!\" FROM \n\t\t\t guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "trial_used",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "premium_owner_id_is_null!",
14 | "type_info": "Bool"
15 | }
16 | ],
17 | "parameters": {
18 | "Left": [
19 | "Int8"
20 | ]
21 | },
22 | "nullable": [
23 | false,
24 | null
25 | ]
26 | },
27 | "hash": "2de65310d2d027b37d33d3862ee993c46cd5bff71059298bb8e73b672fe48d77"
28 | }
29 |
--------------------------------------------------------------------------------
/.sqlx/query-305ccf668cafb08dbc693909679a3fecea341b96ae8fd79d155d8981d7b38bc0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT target_channel FROM default_join_settings WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "target_channel",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "305ccf668cafb08dbc693909679a3fecea341b96ae8fd79d155d8981d7b38bc0"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-34313c87878e50cc7949cc3894b66af169e83820e3fa61bb8f3a6a49f9c1fc01.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO default_join_settings (guild_id, record_transcriptions)\n\t\t\tVALUES ($1, $2)\n\t\t\tON CONFLICT ON CONSTRAINT default_join_settings_pkey\n\t\t\t DO UPDATE SET record_transcriptions = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "34313c87878e50cc7949cc3894b66af169e83820e3fa61bb8f3a6a49f9c1fc01"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-343e3787a742ae6ed8bcb167d2a5ebe8ccd6b29a5d52eca4cb4382391eca39f8.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO vote_reminders (user_id, site_id, next_reminder)\n VALUES ($1, 1, NOW() + INTERVAL '12 hours')\n ON CONFLICT (user_id, site_id)\n DO UPDATE SET next_reminder = NOW() + INTERVAL '12 hours'",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "343e3787a742ae6ed8bcb167d2a5ebe8ccd6b29a5d52eca4cb4382391eca39f8"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-35ae6e890e43bd712a5fcbab383cf0f84b295784587d25301f8d23dbce6a3524.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "DELETE FROM vote_reminders WHERE next_reminder < NOW() RETURNING user_id, site_id, next_reminder",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "user_id",
9 | "type_info": "Int8"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "site_id",
14 | "type_info": "Int2"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "next_reminder",
19 | "type_info": "Timestamp"
20 | }
21 | ],
22 | "parameters": {
23 | "Left": []
24 | },
25 | "nullable": [
26 | false,
27 | false,
28 | false
29 | ]
30 | },
31 | "hash": "35ae6e890e43bd712a5fcbab383cf0f84b295784587d25301f8d23dbce6a3524"
32 | }
33 |
--------------------------------------------------------------------------------
/.sqlx/query-36531a7bbb599e7cb5023020373f126f5d892211e8a28122c24f1f6a5bddfba0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, auto_detect_lang) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET auto_detect_lang = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "36531a7bbb599e7cb5023020373f126f5d892211e8a28122c24f1f6a5bddfba0"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-3bbdfb879d54c4721345f459ac595463c856c8506235e89cc90e334682f50913.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO users (user_id, language) VALUES ($1, $2) ON CONFLICT (user_id) DO UPDATE SET language = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Text"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "3bbdfb879d54c4721345f459ac595463c856c8506235e89cc90e334682f50913"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-3eeba2e6b37d8c469dedecded74692bc5933621ebbeff3397f6dab98402209ed.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT store_msgs FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "store_msgs",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "3eeba2e6b37d8c469dedecded74692bc5933621ebbeff3397f6dab98402209ed"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-41bc5b9e1b49822c841bf923b635efa85b610aa16a603c7abaf6908e89e1d231.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT reason FROM blocked_users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "reason",
9 | "type_info": "Text"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "41bc5b9e1b49822c841bf923b635efa85b610aa16a603c7abaf6908e89e1d231"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-44e187a92daa9453a5465cd057fdeaa7237eb96c13395d7d099b714d85793eff.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT translate FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "translate",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "44e187a92daa9453a5465cd057fdeaa7237eb96c13395d7d099b714d85793eff"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-4960a52935c26aa885840fd942467a65297d10321ae6424781b2ee3ffa4f0875.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT trial_used FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "trial_used",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "4960a52935c26aa885840fd942467a65297d10321ae6424781b2ee3ffa4f0875"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-4b41f197184d8aaa3c397617f4111eb3f77db7015bf9b75693fffd1207e9a00f.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT language FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "language",
9 | "type_info": "Text"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "4b41f197184d8aaa3c397617f4111eb3f77db7015bf9b75693fffd1207e9a00f"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-4e13af608f227e4690755f01dead21bed002225d12237cf75c3bc6e80906fcbe.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT coalesce(premium_level != 0, false) AS \"has_premium!\" FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "has_premium!",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | null
19 | ]
20 | },
21 | "hash": "4e13af608f227e4690755f01dead21bed002225d12237cf75c3bc6e80906fcbe"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-5369c8101c779a94d469be24ab5e593f29247d7cc8ad92f39f971d0dc223f875.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT prefix FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "prefix",
9 | "type_info": "Varchar"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "5369c8101c779a94d469be24ab5e593f29247d7cc8ad92f39f971d0dc223f875"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-597e1b1256bc783fb85af110b378fcdd652b9b0314d5d2f3d6a18aa42a6f1592.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO vote_reminders (user_id, site_id, next_reminder)\n VALUES ($1, 2, NOW() + INTERVAL '20 hours')\n ON CONFLICT (user_id, site_id)\n DO UPDATE SET next_reminder = NOW() + INTERVAL '20 hours'",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "597e1b1256bc783fb85af110b378fcdd652b9b0314d5d2f3d6a18aa42a6f1592"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-5b5a0c282654e3770655e69f6aa80d54ad9dc492f19ca81fc779b2a21a3ef5d2.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds\n \t\t(guild_id)\n\t\t\tVALUES ($1)\n\t\t\tON CONFLICT\n\t\t\t ON CONSTRAINT guilds_pkey\n\t\t\t DO NOTHING",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "5b5a0c282654e3770655e69f6aa80d54ad9dc492f19ca81fc779b2a21a3ef5d2"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-5d29e7b84d7f07dbae3aa1050e29f8118590a1f14c6cff076d89b14fd2e17247.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT COUNT(*) AS \"count!\" FROM automod_rules WHERE source_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "count!",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int4"
15 | ]
16 | },
17 | "nullable": [
18 | null
19 | ]
20 | },
21 | "hash": "5d29e7b84d7f07dbae3aa1050e29f8118590a1f14c6cff076d89b14fd2e17247"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-5e3245cf2ff5bbcc8443a0237fcc5a50d558e6c15313fb33595b49e65477570a.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO blocked_guilds (guild_id, reason, blocked_since) VALUES ($1, $2, $3)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Text",
10 | "Timestamptz"
11 | ]
12 | },
13 | "nullable": []
14 | },
15 | "hash": "5e3245cf2ff5bbcc8443a0237fcc5a50d558e6c15313fb33595b49e65477570a"
16 | }
17 |
--------------------------------------------------------------------------------
/.sqlx/query-5f535bd03724f832cb2c4ad0e5204ef633b789fa8443a5c9d1a9029a4576ac03.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET premium_level = 0, premium_expiry = NULL WHERE user_id = $1",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "5f535bd03724f832cb2c4ad0e5204ef633b789fa8443a5c9d1a9029a4576ac03"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-6368dd70667549f0c0b0b9bf33cce5a62eadc15ffd0ea4fb5437a995a153deb0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT be_verbose FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "be_verbose",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "6368dd70667549f0c0b0b9bf33cce5a62eadc15ffd0ea4fb5437a995a153deb0"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-705f7b60be453ee60099070b5fc5788991e34209f8c0e52f05ed562a7eb52766.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT count(*) AS \"guild_count!\" FROM guilds WHERE premium_owner_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "guild_count!",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | null
19 | ]
20 | },
21 | "hash": "705f7b60be453ee60099070b5fc5788991e34209f8c0e52f05ed562a7eb52766"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-73b99d629e0672d4a609f37bf4ed07ca8164cc4e3d80b0bbaa35dc73d8002d36.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id) VALUES ($1)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "73b99d629e0672d4a609f37bf4ed07ca8164cc4e3d80b0bbaa35dc73d8002d36"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-7aa75622d12ee64a87a749e930bfa042f5e7f770d6eb42938fe6ca4397fdc268.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET store_audio = $1 WHERE user_id = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bool",
9 | "Bytea"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "7aa75622d12ee64a87a749e930bfa042f5e7f770d6eb42938fe6ca4397fdc268"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-7fa4c774189522476a72220b95c4001f89547189eb2aed97067b2688049e8dbf.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET store_audio = NOT store_audio WHERE user_id = $1 RETURNING store_audio",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "store_audio",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "7fa4c774189522476a72220b95c4001f89547189eb2aed97067b2688049e8dbf"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-8079d6b95d5eed89a7ce43e14a25bf9331357013f2f0a9dfbe477916cd22f18d.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "DELETE FROM vote_reminders WHERE user_id = $1",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "8079d6b95d5eed89a7ce43e14a25bf9331357013f2f0a9dfbe477916cd22f18d"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-81c8b76554d6304dea692ac6d7bb95db6b95f381881f7ccdd85d310087e9a46a.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT language FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "language",
9 | "type_info": "Text"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "81c8b76554d6304dea692ac6d7bb95db6b95f381881f7ccdd85d310087e9a46a"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-82c04e99eefafa6df9e39ae70f4de81f7c0d9d5325cb8baa53f08c477c70acdf.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, be_verbose) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET be_verbose = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "82c04e99eefafa6df9e39ae70f4de81f7c0d9d5325cb8baa53f08c477c70acdf"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-85c6d9a2308e670def0903647e7b2f1f41ab934e742b828e839698aea8dfa891.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT premium_level, premium_expiry, is_trialing FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "premium_level",
9 | "type_info": "Int2"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "premium_expiry",
14 | "type_info": "Timestamptz"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "is_trialing",
19 | "type_info": "Bool"
20 | }
21 | ],
22 | "parameters": {
23 | "Left": [
24 | "Bytea"
25 | ]
26 | },
27 | "nullable": [
28 | false,
29 | true,
30 | false
31 | ]
32 | },
33 | "hash": "85c6d9a2308e670def0903647e7b2f1f41ab934e742b828e839698aea8dfa891"
34 | }
35 |
--------------------------------------------------------------------------------
/.sqlx/query-8ad4efd6021caa4fddc8a622623dd02864162e8ae7d0f2d45600a7d0aadaa1fb.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO automod_rules (source_id, rule_type, rule_data, rule_action) VALUES ($1, $2, $3, $4) RETURNING item_id",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int4",
15 | "Int2",
16 | "Text",
17 | "Int2"
18 | ]
19 | },
20 | "nullable": [
21 | false
22 | ]
23 | },
24 | "hash": "8ad4efd6021caa4fddc8a622623dd02864162e8ae7d0f2d45600a7d0aadaa1fb"
25 | }
26 |
--------------------------------------------------------------------------------
/.sqlx/query-8fdff3b23bf87171d6501c2f7a9a66db50f4f9adeb5f0130b415f08f2e30c310.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "UPDATE users SET vote_reminder_enabled = $1 WHERE user_id = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bool",
9 | "Bytea"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "8fdff3b23bf87171d6501c2f7a9a66db50f4f9adeb5f0130b415f08f2e30c310"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-9218ad57bf0ef416cd2b700e771fe38924e159ecdc833a99cd716c772e31be34.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO blocked_users\n\t(user_id, reason, blocked_since)\nVALUES\n\t($1, 'disputed payment', now())\nON CONFLICT\n\tDO NOTHING\n\t\t\t\t",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "9218ad57bf0ef416cd2b700e771fe38924e159ecdc833a99cd716c772e31be34"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-a2abf8a0f150945b1b627443345b17ca90067b1fdc085602e205292f09731457.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, transcript_only_role) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET transcript_only_role = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Int8"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "a2abf8a0f150945b1b627443345b17ca90067b1fdc085602e205292f09731457"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-a55baeff8a9d29d3f4bf93bdce5a8516107f98b21ef7eaf913e1d73cafbad1a1.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO vote_reminders (user_id, site_id, next_reminder)\n VALUES ($1, 3, NOW() + INTERVAL '12 hours')\n ON CONFLICT (user_id, site_id)\n DO UPDATE SET next_reminder = NOW() + INTERVAL '12 hours'",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "a55baeff8a9d29d3f4bf93bdce5a8516107f98b21ef7eaf913e1d73cafbad1a1"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-a61af56279669945475e1bd6c07314ddcc6b8dd48641b187bcf3f92516b680e0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT vote_reminder_enabled FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "vote_reminder_enabled",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "a61af56279669945475e1bd6c07314ddcc6b8dd48641b187bcf3f92516b680e0"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-a70c68916ccaa238c333c30cc7aad03bc9dd4d6045e8701b20c0b184ef43d855.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT auto_join FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "auto_join",
9 | "type_info": "Bool"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "a70c68916ccaa238c333c30cc7aad03bc9dd4d6045e8701b20c0b184ef43d855"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-a79cb39778f193bc5d0f987f046f32e9c5558510474cced79325769001f0ae68.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO audio_store (source_id, audio_data, transcript, transcript_language) VALUES ($1, $2, $3, $4)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Bytea",
10 | "Text",
11 | "Text"
12 | ]
13 | },
14 | "nullable": []
15 | },
16 | "hash": "a79cb39778f193bc5d0f987f046f32e9c5558510474cced79325769001f0ae68"
17 | }
18 |
--------------------------------------------------------------------------------
/.sqlx/query-a87cecbf5594813de9ae09f64bf587c1351b38780227baedb26c86422e2bdaa6.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, language) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET language = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Text"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "a87cecbf5594813de9ae09f64bf587c1351b38780227baedb26c86422e2bdaa6"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-a90b58705c2aa90bd947676b09f5c1bd7cf8de9ac78a57ae007ba1e233e23ff5.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, translate) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET translate = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "a90b58705c2aa90bd947676b09f5c1bd7cf8de9ac78a57ae007ba1e233e23ff5"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-ab63ab3a8a49e4c632a3e8c65b352f129d1b8cf94214bc9cb993084615a7c16f.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO blocked_users (user_id, reason, blocked_since) VALUES ($1, $2, $3)",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Text",
10 | "Timestamptz"
11 | ]
12 | },
13 | "nullable": []
14 | },
15 | "hash": "ab63ab3a8a49e4c632a3e8c65b352f129d1b8cf94214bc9cb993084615a7c16f"
16 | }
17 |
--------------------------------------------------------------------------------
/.sqlx/query-b16a45673e483ada9bfe1a8abbb87d4a340ead03b9eabe78831c57260f4e5c1b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT item_id FROM automod_config WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "b16a45673e483ada9bfe1a8abbb87d4a340ead03b9eabe78831c57260f4e5c1b"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-b6c6c3af88d80513ae83e8f6423b54f0eb8b7344a765f5205b2ae35347e0ee00.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry, is_trialing)\nVALUES\n ($1, 0, NULL, false)\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = 0,\n premium_expiry = NULL,\n is_trialing = false\n ",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "b6c6c3af88d80513ae83e8f6423b54f0eb8b7344a765f5205b2ae35347e0ee00"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-bf767562a1fcd3e989d5d7800f8feb19959cb78d9d68850bd4d18bf3f5d6855f.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT guild_id FROM guilds LIMIT 1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "guild_id",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": []
14 | },
15 | "nullable": [
16 | false
17 | ]
18 | },
19 | "hash": "bf767562a1fcd3e989d5d7800f8feb19959cb78d9d68850bd4d18bf3f5d6855f"
20 | }
21 |
--------------------------------------------------------------------------------
/.sqlx/query-bfca9396251c01fbf9510069699b07a287ac149e0598f5056d25b8582481a44d.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT item_id, rule_type, rule_action, rule_data FROM automod_rules WHERE source_id = (SELECT item_id FROM automod_config WHERE guild_id = $1) ORDER BY item_id ASC",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "item_id",
9 | "type_info": "Int4"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "rule_type",
14 | "type_info": "Int2"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "rule_action",
19 | "type_info": "Int2"
20 | },
21 | {
22 | "ordinal": 3,
23 | "name": "rule_data",
24 | "type_info": "Text"
25 | }
26 | ],
27 | "parameters": {
28 | "Left": [
29 | "Int8"
30 | ]
31 | },
32 | "nullable": [
33 | false,
34 | false,
35 | false,
36 | false
37 | ]
38 | },
39 | "hash": "bfca9396251c01fbf9510069699b07a287ac149e0598f5056d25b8582481a44d"
40 | }
41 |
--------------------------------------------------------------------------------
/.sqlx/query-c582ba49e685230ff575ffeb988d5e400b32202ccdad7f1394ae0a4f534bebd4.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id) VALUES ($1) ON CONFLICT DO NOTHING",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "c582ba49e685230ff575ffeb988d5e400b32202ccdad7f1394ae0a4f534bebd4"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-c59f56d07fec4f68c5c8640e55d12d91d21841bc52f977418f0ac2ca44f95da4.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO default_join_settings (guild_id, target_channel)\n\t\t\t\tVALUES ($1, $2)\n\t\t\t\tON CONFLICT ON CONSTRAINT default_join_settings_pkey\n\t\t\t\t DO UPDATE SET target_channel = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Int8"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "c59f56d07fec4f68c5c8640e55d12d91d21841bc52f977418f0ac2ca44f95da4"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-d18d09060c52e884da8d3118a9506589b1c597eae4e9f1294758cf97513a0655.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO default_join_settings (guild_id, ephemeral)\n\t\t\tVALUES ($1, $2)\n\t\t\tON CONFLICT ON CONSTRAINT default_join_settings_pkey\n\t\t\t DO UPDATE SET ephemeral = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "d18d09060c52e884da8d3118a9506589b1c597eae4e9f1294758cf97513a0655"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-d61f09ce4f51ba7952643cb0f3a73b0e82ad46fffcbee1c80097bf5d4999ba56.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT target_channel FROM per_voice_channel_settings WHERE channel_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "target_channel",
9 | "type_info": "Int8"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | true
19 | ]
20 | },
21 | "hash": "d61f09ce4f51ba7952643cb0f3a73b0e82ad46fffcbee1c80097bf5d4999ba56"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-d87f633a372b2d8a6b22cd2f472d6ede1dad106dc17122e9bc1ee4c6aeda1003.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, transcribe_voice_messages) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET transcribe_voice_messages = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "d87f633a372b2d8a6b22cd2f472d6ede1dad106dc17122e9bc1ee4c6aeda1003"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-d95a944ff53eac4be1375577edabda691086a1475563fbb23c80128f44fc0ede.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n(user_id)\nVALUES ($1)\n ON CONFLICT\n ON CONSTRAINT users_pkey\n DO NOTHING\n ",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "d95a944ff53eac4be1375577edabda691086a1475563fbb23c80128f44fc0ede"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-da69ed66364b8d8e5d0a70a8e789a1bfffa6fe7e7d1380ebe6547f485421a7e0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT COALESCE(\n\t\t\t\t(SELECT language FROM guilds WHERE guild_id = $1),\n\t\t\t\t(SELECT language FROM users WHERE user_id = $2),\n \t'en'\n \t\t) AS \"language!\"",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "language!",
9 | "type_info": "Text"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8",
15 | "Bytea"
16 | ]
17 | },
18 | "nullable": [
19 | null
20 | ]
21 | },
22 | "hash": "da69ed66364b8d8e5d0a70a8e789a1bfffa6fe7e7d1380ebe6547f485421a7e0"
23 | }
24 |
--------------------------------------------------------------------------------
/.sqlx/query-da83b806c17fe16468b9c70136eaf3ded1d1079761919c7a9f2c9f8b53e72f0d.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT new_thread, ephemeral FROM default_join_settings WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "new_thread",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "ephemeral",
14 | "type_info": "Bool"
15 | }
16 | ],
17 | "parameters": {
18 | "Left": [
19 | "Int8"
20 | ]
21 | },
22 | "nullable": [
23 | false,
24 | false
25 | ]
26 | },
27 | "hash": "da83b806c17fe16468b9c70136eaf3ded1d1079761919c7a9f2c9f8b53e72f0d"
28 | }
29 |
--------------------------------------------------------------------------------
/.sqlx/query-dfa520877c017cd5808d02c24ef2d71938b68093974f335a4d89df91874fdaa2.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "DELETE FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "dfa520877c017cd5808d02c24ef2d71938b68093974f335a4d89df91874fdaa2"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-e12aad9daf3df4c789502c6b54d770f6f4141273f107981255b36b67ffd131b3.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO per_voice_channel_settings (channel_id, auto_join_enabled)\n\t\t\t\tVALUES ($1, $2)\n\t\t\t\tON CONFLICT\n\t\t\t\t ON CONSTRAINT per_voice_channel_settings_pkey\n\t\t\t\t DO UPDATE SET auto_join_enabled = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "e12aad9daf3df4c789502c6b54d770f6f4141273f107981255b36b67ffd131b3"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-e1758cf7ba1424941e3c07f12c0b28f338781ab348743979c57d8a8e8336a9b7.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT premium_level FROM users INNER JOIN guilds g on users.user_id = g.premium_owner_id WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "premium_level",
9 | "type_info": "Int2"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Int8"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "e1758cf7ba1424941e3c07f12c0b28f338781ab348743979c57d8a8e8336a9b7"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-e20129046ffbefeacec498611c65ecaa944eae3ca76f87b02c93118aa663791b.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry, is_trialing)\nVALUES\n ($1, 0, NULL, false)\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = 0,\n premium_expiry = NULL,\n is_trialing = false\n",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "e20129046ffbefeacec498611c65ecaa944eae3ca76f87b02c93118aa663791b"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-eb1135121d7f409c041eff3645dec66471e99d4cc0c0e689fe137bad90ee70f0.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO default_join_settings (guild_id, new_thread)\n\t\t\tVALUES ($1, $2)\n\t\t\tON CONFLICT ON CONSTRAINT default_join_settings_pkey\n\t\t\t DO UPDATE SET new_thread = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "eb1135121d7f409c041eff3645dec66471e99d4cc0c0e689fe137bad90ee70f0"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-ebb2c791e92fec2e5b8f0ccbf10b9e0da345e40a2054c74652c4eb7842f88ed5.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO per_voice_channel_settings (channel_id, target_channel)\n\t\t\t\tVALUES ($1, $2)\n\t\t\t \tON CONFLICT ON CONSTRAINT per_voice_channel_settings_pkey\n\t\t\t \t DO UPDATE SET target_channel = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Int8"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "ebb2c791e92fec2e5b8f0ccbf10b9e0da345e40a2054c74652c4eb7842f88ed5"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-ed9c186510d2e3d31b1634a1db068e786996dcb6c0dc741dc207df9f73ce4b7a.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, auto_join) VALUES ($1, $2) ON CONFLICT ON CONSTRAINT guilds_pkey DO UPDATE SET auto_join = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "ed9c186510d2e3d31b1634a1db068e786996dcb6c0dc741dc207df9f73ce4b7a"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-f1127d19808b04e64dbb74fddccd72146bb25d96661bf4ce473d0be6fddcbd23.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (premium_owner_id, guild_id) VALUES ($1, $2) ON CONFLICT ON CONSTRAINT guilds_pkey DO UPDATE SET premium_owner_id = $1",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Int8"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "f1127d19808b04e64dbb74fddccd72146bb25d96661bf4ce473d0be6fddcbd23"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-f2b76182252d68d938737226b537ddff4930ff59af6dd60bfbb15e11236cdfdb.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT be_verbose, language, auto_detect_lang, transcript_only_role, translate, kiai_enabled FROM guilds WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "be_verbose",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "language",
14 | "type_info": "Text"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "auto_detect_lang",
19 | "type_info": "Bool"
20 | },
21 | {
22 | "ordinal": 3,
23 | "name": "transcript_only_role",
24 | "type_info": "Int8"
25 | },
26 | {
27 | "ordinal": 4,
28 | "name": "translate",
29 | "type_info": "Bool"
30 | },
31 | {
32 | "ordinal": 5,
33 | "name": "kiai_enabled",
34 | "type_info": "Bool"
35 | }
36 | ],
37 | "parameters": {
38 | "Left": [
39 | "Int8"
40 | ]
41 | },
42 | "nullable": [
43 | false,
44 | false,
45 | false,
46 | true,
47 | false,
48 | false
49 | ]
50 | },
51 | "hash": "f2b76182252d68d938737226b537ddff4930ff59af6dd60bfbb15e11236cdfdb"
52 | }
53 |
--------------------------------------------------------------------------------
/.sqlx/query-f2f065836ccd89c512070fad43b04c5e0a842c6cb7ba09dac4439239db761f74.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT premium_level FROM users WHERE user_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "premium_level",
9 | "type_info": "Int2"
10 | }
11 | ],
12 | "parameters": {
13 | "Left": [
14 | "Bytea"
15 | ]
16 | },
17 | "nullable": [
18 | false
19 | ]
20 | },
21 | "hash": "f2f065836ccd89c512070fad43b04c5e0a842c6cb7ba09dac4439239db761f74"
22 | }
23 |
--------------------------------------------------------------------------------
/.sqlx/query-f3edc5bc2652e4dd2e9ea1bf9dcdeb7a98fe957e4898da60413c356dd82e7c29.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry)\nVALUES\n ($1, 1, to_timestamp($2))\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = 1,\n premium_expiry = to_timestamp($2)\n",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea",
9 | "Float8"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "f3edc5bc2652e4dd2e9ea1bf9dcdeb7a98fe957e4898da60413c356dd82e7c29"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-f4a7c95fdaba6a38ffe1bd3177687ff90e52c8592310914c876d668e8dd30ec1.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds\n \t\t(guild_id, prefix)\n\t\t\tVALUES ($1, $2)\n\t\t\tON CONFLICT\n\t\t\t ON CONSTRAINT guilds_pkey \n\t\t\t DO UPDATE SET prefix = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Varchar"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "f4a7c95fdaba6a38ffe1bd3177687ff90e52c8592310914c876d668e8dd30ec1"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-f89f8a631ebf9bd1c26cfff8d7323ac758f64807e49c9e3179979efb78875c71.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO users (user_id) VALUES ($1) ON CONFLICT ON CONSTRAINT users_pkey DO NOTHING",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "f89f8a631ebf9bd1c26cfff8d7323ac758f64807e49c9e3179979efb78875c71"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-fa9bd7bdaa7ecd515b79993101eacfb3c3b0394fc7e6a75c5bec43c239a9ef90.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "\nINSERT INTO users\n (user_id, premium_level, premium_expiry, is_trialing)\nVALUES\n ($1, 0, NULL, false)\nON CONFLICT\n ON CONSTRAINT users_pkey\n DO UPDATE\n SET\n premium_level = 0,\n premium_expiry = NULL,\n is_trialing = false",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Bytea"
9 | ]
10 | },
11 | "nullable": []
12 | },
13 | "hash": "fa9bd7bdaa7ecd515b79993101eacfb3c3b0394fc7e6a75c5bec43c239a9ef90"
14 | }
15 |
--------------------------------------------------------------------------------
/.sqlx/query-fd57884a830694a5fc149d1ef72983eb444c0c15371e8771e0136ca848afa105.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "INSERT INTO guilds (guild_id, kiai_enabled) VALUES ($1, $2) ON CONFLICT (guild_id) DO UPDATE SET kiai_enabled = $2",
4 | "describe": {
5 | "columns": [],
6 | "parameters": {
7 | "Left": [
8 | "Int8",
9 | "Bool"
10 | ]
11 | },
12 | "nullable": []
13 | },
14 | "hash": "fd57884a830694a5fc149d1ef72983eb444c0c15371e8771e0136ca848afa105"
15 | }
16 |
--------------------------------------------------------------------------------
/.sqlx/query-fe0b5b46dc49b47641b4c7811fc7bdf7966bad815cbf02d6f3c2e5721445f256.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "PostgreSQL",
3 | "query": "SELECT record_transcriptions, target_channel, new_thread, ephemeral FROM default_join_settings WHERE guild_id = $1",
4 | "describe": {
5 | "columns": [
6 | {
7 | "ordinal": 0,
8 | "name": "record_transcriptions",
9 | "type_info": "Bool"
10 | },
11 | {
12 | "ordinal": 1,
13 | "name": "target_channel",
14 | "type_info": "Int8"
15 | },
16 | {
17 | "ordinal": 2,
18 | "name": "new_thread",
19 | "type_info": "Bool"
20 | },
21 | {
22 | "ordinal": 3,
23 | "name": "ephemeral",
24 | "type_info": "Bool"
25 | }
26 | ],
27 | "parameters": {
28 | "Left": [
29 | "Int8"
30 | ]
31 | },
32 | "nullable": [
33 | false,
34 | true,
35 | false,
36 | false
37 | ]
38 | },
39 | "hash": "fe0b5b46dc49b47641b4c7811fc7bdf7966bad815cbf02d6f3c2e5721445f256"
40 | }
41 |
--------------------------------------------------------------------------------
/.weblate:
--------------------------------------------------------------------------------
1 | [weblate]
2 | url = https://hosted.weblate.org/api/
3 | translation = scripty-bot/scripty-bot
4 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rustlang/rust:nightly-bookworm as build
2 |
3 | WORKDIR /scripty
4 |
5 | COPY . .
6 |
7 | RUN apt update -y
8 | RUN apt install -y clang mold libopus-dev libopus0
9 |
10 | ENV RUSTFLAGS="--emit=asm --cfg tokio_unstable -Clink-arg=-fuse-ld=mold -Zshare-generics=y"
11 | ENV SQLX_OFFLINE=1
12 |
13 |
14 | RUN cargo build --release
15 |
16 | FROM debian:bookworm-slim
17 |
18 | COPY --from=build /usr/lib/x86_64-linux-gnu/libopus.so.0.8.0 /usr/lib/x86_64-linux-gnu/libopus.so.0.8.0
19 | COPY --from=build /usr/lib/x86_64-linux-gnu/libopus.so.0 /usr/lib/x86_64-linux-gnu/libopus.so.0
20 |
21 | WORKDIR /app
22 | COPY --from=build /scripty/target/release/scripty_v2 .
23 |
24 | RUN adduser --home /nonexistent --no-create-home --disabled-password scripty
25 | USER scripty
26 |
27 | VOLUME "/app/config.toml"
28 |
29 | CMD ["/app/scripty_v2", "/app/config.toml"]
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Scripty (v2)
2 |
3 | rewrite of the [old Scripty](https://github.com/tazz4843/scripty) in general
4 |
5 | ## selfhosting
6 |
7 | ### native binary
8 |
9 | this is what scripty is running on in production and is actively tested
10 |
11 | see [the prebuilt binary](./doc/selfhosting-prebuilt.md)
12 | or [build from source](./doc/selfhosting-from-source.md) guides
13 |
14 | ### podman
15 |
16 | much less native support given
17 |
18 | [see the docs](./doc/selfhosting-podman.md)
19 |
20 | ## translations?
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/deny.toml:
--------------------------------------------------------------------------------
1 | targets = [
2 | { triple = "x86_64-unknown-linux-gnu" },
3 | { triple = "x86_64-unknown-linux-musl" }
4 | ]
5 |
6 | [advisories]
7 | vulnerability = "deny"
8 | unmaintained = "deny"
9 | notice = "deny"
10 | unsound = "deny"
11 |
12 | [bans]
13 | deny = [
14 | # we hate OpenSSL
15 | { name = "openssl" },
16 | { name = "openssl-sys" },
17 | ]
18 | wildcards = "deny"
19 | allow-wildcard-paths = true
20 | highlight = "simplest-path"
21 |
22 |
23 | [sources]
24 | unknown-registry = "deny"
25 | unknown-git = "deny"
26 | required-git-spec = "branch"
27 |
28 | [sources.allow-org]
29 | github = ["scripty-bot", "tazz4843", "serenity-rs"]
30 |
31 | [licenses]
32 | unlicensed = "deny"
33 | copyleft = "allow"
34 | allow-osi-fsf-free = "either"
35 |
36 | [[licenses.clarify]]
37 | name = "ring"
38 | # SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses
39 | # https://spdx.org/licenses/OpenSSL.html
40 | # ISC - Both BoringSSL and ring use this for their new files
41 | # MIT - "Files in third_party/ have their own licenses, as described therein. The MIT
42 | # license, for third_party/fiat, which, unlike other third_party directories, is
43 | # compiled into non-test libraries, is included below."
44 | # OpenSSL - Obviously
45 | expression = "ISC AND MIT AND OpenSSL"
46 | license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
47 |
--------------------------------------------------------------------------------
/doc/selfhosting-podman.md:
--------------------------------------------------------------------------------
1 | # selfhosting scripty via podman
2 |
3 | ## notes
4 |
5 | Scripty's pre-built binaries only support x86_64 Linux:
6 | if you're on another system you must [build from source](./selfhosting-from-source.md)
7 |
8 | the podman build is completely untested
9 |
10 | the binary runs but i have not tested if it's actually functional,
11 | so expect broken stuff sometimes
12 |
13 | official support for broken stuff is available, poke me on scripty's discord
14 |
15 | rootful docker will never be officially supported, but it'll likely work anyway.
16 | you should not be using rootful though because it's a massive security hole,
17 | and if you ask for help while using rootful i'll tell you to use rootless or podman
18 |
19 | rootless is essentially equivalent to podman, just substitute `docker` for `podman` in commands
20 |
21 | ## the image
22 |
23 | this repo automatically builds a podman image every commit at
24 | https://github.com/scripty-bot/scripty/pkgs/container/scripty
25 |
26 | pull it with
27 |
28 | ```bash
29 | podman pull ghcr.io/scripty-bot/scripty:master
30 | ```
31 |
32 | ## running
33 |
34 | it expects `config.toml` mounted at `/app/config.toml`,
35 | and scripty's internal webserver binds on `127.0.0.1:42069` by default.
36 | change as necessary
37 |
38 | a postgres database must be accessible somehow, configure that yourself
39 |
40 | ```bash
41 | podman run -p 42069:42069 -v "./config.toml:/app/config.toml:ro" ghcr.io/scripty-bot/scripty:master
42 | ```
43 |
--------------------------------------------------------------------------------
/doc/selfhosting-prebuilt.md:
--------------------------------------------------------------------------------
1 | # selfhosting scripty - prebuilt executable
2 |
3 | only supports linux, will not support any other OS, especially not windows
4 |
5 | WSL does not count as linux, use a VM at the very least (although good luck getting GPU passthrough)
6 |
7 | Scripty's pre-built binaries only support x86_64 Linux using glibc:
8 | if you're on another system you must [build from source](./selfhosting-from-source.md)
9 |
10 | ## clone the repo
11 |
12 | some files in the repo are required for scripty to run
13 | (mostly internationalization files)
14 |
15 | ```bash
16 | git clone https://github.com/scripty-bot/scripty
17 | cd scripty
18 | ```
19 |
20 | ## download the binary
21 |
22 | each commit builds a binary
23 |
24 | 1. head to the github web UI and
25 | click the action icon directly to the right of the latest commit title
26 | 2. click "Details" to the right of "Build executable / Build binary"
27 | 3. click summary in the upper left
28 | 4. scroll down to artifacts
29 | 5. hit the download button on `scripty_v2-x86_64-unknown-linux-gnu`
30 | 6. save to a convenient location (most likely directly in the root directory of the repo)
31 |
32 | ## running
33 |
34 | continue from the "migrate database" section of the [build from source page](./selfhosting-from-source.md),
35 | and skip the "build" section
36 |
--------------------------------------------------------------------------------
/migrations/20220205060135_initial_migration.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS guilds (
2 | guild_id BIGINT PRIMARY KEY NOT NULL,
3 | target_channel BIGINT,
4 | -- later scripty will have language cfgs
5 | language CHAR(5),
6 | be_verbose BOOLEAN,
7 | premium_level SMALLINT
8 | );
9 |
10 | CREATE TABLE IF NOT EXISTS users (
11 | user_id BIGINT PRIMARY KEY NOT NULL,
12 | github_account TEXT,
13 | premium_level SMALLINT NOT NULL DEFAULT 0,
14 | used_servers SMALLINT NOT NULL DEFAULT 0
15 | );
16 |
17 | CREATE TABLE IF NOT EXISTS prefixes (
18 | guild_id BIGINT PRIMARY KEY NOT NULL,
19 | prefix VARCHAR(10)
20 | );
21 |
22 | CREATE TABLE IF NOT EXISTS channels (
23 | channel_id BIGINT PRIMARY KEY NOT NULL,
24 | webhook_id BIGINT NOT NULL,
25 | webhook_token TEXT NOT NULL
26 | );
27 |
--------------------------------------------------------------------------------
/migrations/20220206034602_blocked_entities.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS blocked_users (
2 | user_id BIGINT PRIMARY KEY,
3 | reason TEXT,
4 | blocked_since TIMESTAMP WITHOUT TIME ZONE
5 | );
6 |
7 | CREATE TABLE IF NOT EXISTS blocked_guilds (
8 | guild_id BIGINT PRIMARY KEY,
9 | reason TEXT,
10 | blocked_since TIMESTAMP WITHOUT TIME ZONE
11 | );
12 |
--------------------------------------------------------------------------------
/migrations/20220208005540_convert_to_not_null.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE guilds ALTER COLUMN target_channel SET NOT NULL;
2 | ALTER TABLE guilds ALTER COLUMN language SET NOT NULL;
3 | ALTER TABLE guilds ALTER COLUMN be_verbose SET NOT NULL;
4 | ALTER TABLE guilds ALTER COLUMN premium_level SET NOT NULL;
5 |
--------------------------------------------------------------------------------
/migrations/20220213083816_more_user_fields.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE users ADD COLUMN store_audio BOOLEAN NOT NULL DEFAULT false;
2 | ALTER TABLE users ADD COLUMN store_msgs BOOLEAN NOT NULL DEFAULT false;
3 |
--------------------------------------------------------------------------------
/migrations/20220323050213_add_user_language.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE users ADD COLUMN language varchar(5) NOT NULL DEFAULT 'en';
2 |
--------------------------------------------------------------------------------
/migrations/20220324042751_change_user_language_column_type.sql:
--------------------------------------------------------------------------------
1 | -- change the type of column language in users table from varchar(5) to text
2 | ALTER TABLE users ALTER COLUMN language TYPE text;
3 | -- change the type of column language in guilds table from varchar(5) to text
4 | ALTER TABLE guilds ALTER COLUMN language TYPE text;
5 | -- change the default value of column language in guilds table to 'en'
6 | ALTER TABLE guilds ALTER COLUMN language SET DEFAULT 'en';
--------------------------------------------------------------------------------
/migrations/20220324044030_change_defaults.sql:
--------------------------------------------------------------------------------
1 | -- remove not null constraint on column "target_channel" in table "guilds"
2 | ALTER TABLE guilds ALTER COLUMN target_channel DROP NOT NULL;
3 | -- remove default value on column "target_channel" in table "guilds"
4 | ALTER TABLE guilds ALTER COLUMN target_channel DROP DEFAULT;
5 |
6 | -- set default value on column "language" in table "guilds" to "en"
7 | ALTER TABLE guilds ALTER COLUMN language SET DEFAULT 'en';
8 |
9 | -- set default value on column "be_verbose" in table "guilds" to false
10 | ALTER TABLE guilds ALTER COLUMN be_verbose SET DEFAULT false;
11 |
12 | -- set default value on column "premium_level" in table "guilds" to 0
13 | ALTER TABLE guilds ALTER COLUMN premium_level SET DEFAULT 0;
14 |
--------------------------------------------------------------------------------
/migrations/20220422014155_convert_userids_to_hashed.sql:
--------------------------------------------------------------------------------
1 | -- user IDs are now going to be hashed with sha512
2 | -- targets:
3 | -- - audio_store (source_id)
4 | -- - message_store (author_id)
5 | -- - blocked_users (user_id)
6 | -- - users (user_id)
7 |
8 | -- the existing type is bigint, which is difficult to migrate to bytea
9 | -- so just drop and recreate the two columns
10 | ALTER TABLE audio_store DROP COLUMN source_id;
11 | ALTER TABLE message_store DROP COLUMN author_id;
12 | ALTER TABLE blocked_users DROP COLUMN user_id;
13 | ALTER TABLE users DROP COLUMN user_id;
14 |
15 | -- recreate the columns
16 | ALTER TABLE users ADD COLUMN user_id bytea NOT NULL PRIMARY KEY;
17 | ALTER TABLE audio_store ADD COLUMN source_id bytea NOT NULL REFERENCES users(user_id) ON DELETE CASCADE;
18 | ALTER TABLE message_store ADD COLUMN author_id bytea NOT NULL REFERENCES users(user_id) ON DELETE CASCADE;
19 | ALTER TABLE blocked_users ADD COLUMN user_id bytea NOT NULL REFERENCES users(user_id) ON DELETE CASCADE PRIMARY KEY;
20 |
--------------------------------------------------------------------------------
/migrations/20220619210730_default_for_audio_store_ID.sql:
--------------------------------------------------------------------------------
1 | -- language: psql
2 | -- alter column id on table audio_store to be auto-incrementing
3 | ALTER TABLE audio_store DROP COLUMN id;
4 | ALTER TABLE audio_store ADD COLUMN id SERIAL PRIMARY KEY;
5 |
--------------------------------------------------------------------------------
/migrations/20220707194906_remove_author_id_and_message_id_from_message_store.sql:
--------------------------------------------------------------------------------
1 | -- language: postgres
2 | -- drop two identifying columns
3 | ALTER TABLE message_store DROP COLUMN message_id;
4 | ALTER TABLE message_store DROP COLUMN author_id;
5 | -- replace the message_id column with a primary key that is independent of message IDs
6 | ALTER TABLE message_store ADD COLUMN message_id BIGSERIAL PRIMARY KEY;
7 |
--------------------------------------------------------------------------------
/migrations/20220707232119_switch_type_of_message_content.sql:
--------------------------------------------------------------------------------
1 | -- language: postgres
2 | ALTER TABLE message_store DROP COLUMN text;
3 | ALTER TABLE message_store ADD COLUMN message_content bytea;
4 |
--------------------------------------------------------------------------------
/migrations/20220707232647_not_null_message_content.sql:
--------------------------------------------------------------------------------
1 | -- language: postgres
2 | ALTER TABLE message_store ALTER COLUMN message_content SET NOT NULL;
3 | ALTER TABLE message_store ALTER COLUMN message_content DROP DEFAULT;
4 |
--------------------------------------------------------------------------------
/migrations/20220708045546_save_nonce_with_message_content.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE message_store ADD COLUMN nonce BYTEA NOT NULL;
2 |
--------------------------------------------------------------------------------
/migrations/20220801052859_alter_premium_layout.sql:
--------------------------------------------------------------------------------
1 | -- language: postgres
2 |
3 | -- drop unnecessary columns now
4 | ALTER TABLE users DROP COLUMN github_account;
5 | ALTER TABLE users DROP COLUMN used_servers;
6 |
7 | ALTER TABLE guilds DROP COLUMN premium_level;
8 |
9 |
10 | -- add new columns
11 | ALTER TABLE users ADD COLUMN trial_used BOOLEAN DEFAULT FALSE NOT NULL;
12 | ALTER TABLE guilds ADD COLUMN trial_used BOOLEAN DEFAULT FALSE NOT NULL;
13 |
14 | ALTER TABLE users ADD COLUMN premium_expiry TIMESTAMP DEFAULT NULL;
15 |
16 | ALTER TABLE guilds ADD COLUMN premium_owner_id BYTEA DEFAULT NULL REFERENCES users(user_id) ON DELETE SET NULL;
17 |
--------------------------------------------------------------------------------
/migrations/20220801061346_add_is_trialing_to_user.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE users ADD COLUMN is_trialing BOOLEAN NOT NULL DEFAULT FALSE;
--------------------------------------------------------------------------------
/migrations/20220801063251_add_timezone_to_timestamps_because_sqlx_doesn't_support_without.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE users ALTER COLUMN premium_expiry TYPE TIMESTAMP WITH TIME ZONE;
2 |
--------------------------------------------------------------------------------
/migrations/20220801222122_add_timezone_to_timestamps_pt_2.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE blocked_users ALTER COLUMN blocked_since TYPE TIMESTAMP WITH TIME ZONE USING blocked_since::timestamp;
2 | ALTER TABLE blocked_guilds ALTER COLUMN blocked_since TYPE TIMESTAMP WITH TIME ZONE USING blocked_since::timestamp;
3 |
--------------------------------------------------------------------------------
/migrations/20220824213251_remove_channels_table.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE guilds DROP CONSTRAINT guilds_premium_owner_id_fkey;
2 | DROP TABLE channels;
3 |
--------------------------------------------------------------------------------
/migrations/20221122161618_automod_tables.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | -- language: postgresql
3 |
4 | -- add automod table
5 | CREATE TABLE automod_config (
6 | item_id SERIAL PRIMARY KEY,
7 | guild_id bigint NOT NULL REFERENCES guilds (guild_id) ON DELETE CASCADE UNIQUE,
8 | enabled boolean NOT NULL DEFAULT false,
9 | log_channel_id bigint NOT NULL,
10 |
11 | -- if rule action is 2 or 3, log a recording of the message?
12 | log_recording boolean NOT NULL DEFAULT false,
13 |
14 | -- automatically join a voice channel if a user joins a voice channel?
15 | auto_join_voice boolean NOT NULL DEFAULT true
16 | );
17 |
18 | CREATE TABLE automod_rules (
19 | item_id SERIAL PRIMARY KEY,
20 | source_id bigint NOT NULL REFERENCES automod_config (item_id) ON DELETE CASCADE,
21 |
22 | -- rule type: currently only one type is supported, added for future expansion
23 | -- 1 for regular text match
24 | rule_type SMALLINT NOT NULL,
25 |
26 | -- rule data: any attached data to the rule, such as text to match
27 | rule_data TEXT NOT NULL,
28 |
29 | -- rule action: what to do when the rule is triggered
30 | -- 1 for silent delete
31 | -- 2 for delete and log
32 | -- 3 for delete, log, and remove user from voice
33 | rule_action SMALLINT NOT NULL
34 | );
35 |
--------------------------------------------------------------------------------
/migrations/20221124000934_add_unique_constraint_for_automod.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | -- language: postgresql
3 |
4 | -- add a unique constraint to table automod_rules, on columns rule_type, rule_data, rule_action, and source_id
5 | ALTER TABLE automod_rules ADD CONSTRAINT unique_rule UNIQUE (rule_type, rule_data, rule_action, source_id);
6 |
--------------------------------------------------------------------------------
/migrations/20221127221641_fix_table_types.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE automod_rules ALTER COLUMN source_id TYPE integer;
--------------------------------------------------------------------------------
/migrations/20230607172816_voice_message_enable.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE guilds ADD COLUMN transcribe_voice_messages bool NOT NULL DEFAULT true;
2 |
--------------------------------------------------------------------------------
/migrations/20230814023409_remove_target_channel_and_add_agreed_tos.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds DROP COLUMN target_channel;
3 | ALTER TABLE guilds ADD COLUMN agreed_tos boolean NOT NULL DEFAULT false;
4 |
--------------------------------------------------------------------------------
/migrations/20231014010314_guild_all_audio_file_transcription.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN transcribe_audio_files BOOLEAN NOT NULL DEFAULT FALSE;
--------------------------------------------------------------------------------
/migrations/20231014175034_guild_all_video_file_transcription.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN transcribe_video_files BOOLEAN NOT NULL DEFAULT false;
--------------------------------------------------------------------------------
/migrations/20231129024221_guild_auto_detect_lang.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN auto_detect_lang BOOLEAN NOT NULL DEFAULT FALSE;
3 |
--------------------------------------------------------------------------------
/migrations/20231202032922_guild_transcript_only_role_members.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN transcript_only_role BIGINT DEFAULT NULL;
3 |
--------------------------------------------------------------------------------
/migrations/20231211021825_translate_to_english.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN translate BOOLEAN NOT NULL DEFAULT FALSE;
3 |
--------------------------------------------------------------------------------
/migrations/20231211023309_translate_to_english_enabled_by_default.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ALTER COLUMN translate SET DEFAULT true;
3 |
--------------------------------------------------------------------------------
/migrations/20231216214434_vote_reminder_table.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | CREATE TABLE vote_reminders (
3 | user_id BIGINT NOT NULL,
4 | site_id SMALLINT NOT NULL,
5 | next_reminder TIMESTAMP NOT NULL,
6 |
7 | PRIMARY KEY (user_id, site_id)
8 | );
9 |
--------------------------------------------------------------------------------
/migrations/20231217034034_vote_reminder_opt_out.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE users ADD COLUMN vote_reminder_disabled BOOLEAN NOT NULL DEFAULT FALSE;
3 |
--------------------------------------------------------------------------------
/migrations/20231229163655_vote_reminder_enabled.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE users DROP COLUMN vote_reminder_disabled;
3 | ALTER TABLE users ADD COLUMN vote_reminder_enabled boolean NOT NULL DEFAULT true;
4 |
--------------------------------------------------------------------------------
/migrations/20240115205731_kiai_integration_enabled.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds ADD COLUMN kiai_enabled BOOLEAN NOT NULL DEFAULT FALSE;
3 |
--------------------------------------------------------------------------------
/migrations/20240415174617_remove_tos_agree.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds
3 | DROP COLUMN agreed_tos;
4 |
--------------------------------------------------------------------------------
/migrations/20240920165244_default_translate_to_false.sql:
--------------------------------------------------------------------------------
1 | -- Add migration script here
2 | ALTER TABLE guilds
3 | ALTER COLUMN translate SET DEFAULT FALSE;
--------------------------------------------------------------------------------
/migrations/20250119180948_add_default_command_parameter_options.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS default_join_settings
2 | (
3 | guild_id BIGINT NOT NULL PRIMARY KEY REFERENCES guilds,
4 | record_transcriptions BOOLEAN DEFAULT FALSE NOT NULL,
5 | target_channel BIGINT DEFAULT NULL,
6 | new_thread BOOLEAN DEFAULT FALSE NOT NULL,
7 | ephemeral BOOLEAN DEFAULT FALSE NOT NULL
8 | );
9 |
--------------------------------------------------------------------------------
/migrations/20250222001334_move_auto_join_to_config.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE guilds
2 | ADD COLUMN auto_join BOOLEAN NOT NULL DEFAULT FALSE;
3 |
4 | -- automigrate data from automod_config to guilds
5 | -- default false covers the other cases
6 | UPDATE guilds
7 | SET auto_join = true
8 | WHERE guild_id IN (SELECT guild_id FROM automod_config WHERE auto_join_voice = true);
9 |
10 | ALTER TABLE automod_config
11 | DROP COLUMN auto_join_voice;
12 |
13 | -- clean up any servers that used automod only for the auto join function
14 | DELETE
15 | FROM automod_config AS r
16 | WHERE NOT EXISTS (SELECT source_id FROM automod_rules WHERE source_id = r.item_id);
17 |
--------------------------------------------------------------------------------
/migrations/20250302041748_fix_fkey_relations.sql:
--------------------------------------------------------------------------------
1 | -- stop errors when a user requests to have their data deleted and themselves banned
2 | ALTER TABLE blocked_users
3 | DROP CONSTRAINT blocked_users_user_id_fkey;
4 |
--------------------------------------------------------------------------------
/migrations/20250302043001_move_prefixes_into_guilds_table.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE prefixes;
2 |
3 | ALTER TABLE guilds
4 | ADD COLUMN prefix varchar(8) DEFAULT NULL;
5 |
--------------------------------------------------------------------------------
/migrations/20250525065734_per_voice_channel_target_channel.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE per_voice_channel_settings
2 | (
3 | channel_id BIGINT NOT NULL PRIMARY KEY,
4 | target_channel BIGINT NULL DEFAULT NULL
5 | );
6 |
--------------------------------------------------------------------------------
/migrations/20250526220035_per_voice_channel_auto_join_settings.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE scripty.public.per_voice_channel_settings
2 | ADD COLUMN auto_join_enabled BOOLEAN NOT NULL DEFAULT TRUE;
3 |
--------------------------------------------------------------------------------
/prometheus.yml:
--------------------------------------------------------------------------------
1 | global:
2 | scrape_interval: 15s
3 |
4 | scrape_configs:
5 | - job_name: scripty
6 | static_configs:
7 | targets:
8 | - 'localhost:42069'
9 |
--------------------------------------------------------------------------------
/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "nightly"
3 |
--------------------------------------------------------------------------------
/rustfmt.toml:
--------------------------------------------------------------------------------
1 | hard_tabs = true # Not up to negotiation.
2 | enum_discrim_align_threshold = 20
3 | hex_literal_case = "Lower"
4 | imports_layout = "HorizontalVertical"
5 | imports_granularity = "Crate"
6 | newline_style = "Unix"
7 | normalize_comments = true
8 | reorder_impl_items = true
9 | group_imports = "StdExternalCrate"
10 | struct_field_align_threshold = 20
11 | format_strings = true
12 |
--------------------------------------------------------------------------------
/scripty_audio_handler/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "scripty_audio_handler"
3 | version.workspace = true
4 | edition.workspace = true
5 | license.workspace = true
6 | homepage.workspace = true
7 | repository.workspace = true
8 |
9 | [lints]
10 | workspace = true
11 |
12 | [dependencies]
13 | sqlx.workspace = true
14 | ahash.workspace = true
15 | tokio.workspace = true
16 | dashmap.workspace = true
17 | tracing.workspace = true
18 | secrecy.workspace = true
19 | songbird.workspace = true
20 | serenity.workspace = true
21 | backtrace.workspace = true
22 | async-trait.workspace = true
23 |
24 | scripty_db = { path = "../scripty_db" }
25 | scripty_stt = { path = "../scripty_stt" }
26 | #scripty_tts = { path = "../scripty_tts" }
27 | scripty_error = { path = "../scripty_error" }
28 | scripty_utils = { path = "../scripty_utils" }
29 | scripty_redis = { path = "../scripty_redis" }
30 | scripty_automod = { path = "../scripty_automod" }
31 | scripty_metrics = { path = "../scripty_metrics" }
32 | scripty_premium = { path = "../scripty_premium" }
33 | scripty_data_type = { path = "../scripty_data_type" }
34 | scripty_integrations = { path = "../scripty_integrations" }
35 | scripty_data_storage = { path = "../scripty_data_storage" }
36 |
--------------------------------------------------------------------------------
/scripty_audio_handler/src/consts.rs:
--------------------------------------------------------------------------------
1 | pub const SIZE_OF_I16: usize = std::mem::size_of::();
2 |
--------------------------------------------------------------------------------
/scripty_audio_handler/src/disconnect.rs:
--------------------------------------------------------------------------------
1 | use std::time::Duration;
2 |
3 | use dashmap::DashMap;
4 | use scripty_data_type::get_data;
5 | use scripty_error::Error;
6 | use serenity::{gateway::client::Context, model::id::GuildId};
7 | use songbird::error::JoinError;
8 |
9 | pub async fn disconnect_from_vc(ctx: &Context, guild_id: GuildId) -> Result {
10 | let sb = crate::get_songbird();
11 | let res = match sb.remove(guild_id).await {
12 | Ok(()) => Ok(true),
13 | Err(JoinError::NoCall) => Ok(false),
14 | Err(e) => Err(e.into()),
15 | };
16 |
17 | let _ = get_data(ctx).existing_calls.force_remove_guild(&guild_id);
18 |
19 | let existing = super::AUTO_LEAVE_TASKS
20 | .get_or_init(|| DashMap::with_hasher(ahash::RandomState::default()))
21 | .remove(&guild_id);
22 | if let Some(existing) = existing {
23 | // cancel the existing auto-leave task
24 | let _ = existing.1.send(()); // ignore errors as the task may have already been cancelled
25 | }
26 |
27 | tokio::spawn(async move {
28 | const FIVE_SECONDS: Duration = Duration::from_secs(5);
29 | tokio::time::sleep(FIVE_SECONDS).await;
30 | crate::force_handler_update(&guild_id);
31 | });
32 |
33 | res
34 | }
35 |
--------------------------------------------------------------------------------
/scripty_audio_handler/src/events/driver_connect.rs:
--------------------------------------------------------------------------------
1 | use songbird::id::GuildId;
2 |
3 | use crate::audio_handler::ArcSsrcMaps;
4 |
5 | pub async fn driver_connect(
6 | session_id: String,
7 | guild_id: GuildId,
8 | ssrc: u32,
9 | ssrc_state: ArcSsrcMaps,
10 | ) {
11 | debug!(
12 | "connected to Discord voice gateway: session ID {} for guild {}, with ssrc {}",
13 | session_id, guild_id, ssrc
14 | );
15 |
16 | // ignore self
17 | ssrc_state.ssrc_ignored_map.insert(ssrc, true);
18 | }
19 |
--------------------------------------------------------------------------------
/scripty_audio_handler/src/events/mod.rs:
--------------------------------------------------------------------------------
1 | mod client_disconnect;
2 | mod driver_connect;
3 | mod driver_disconnect;
4 | mod rtp_packet;
5 | mod speaking_state_update;
6 | mod voice_tick;
7 |
8 | pub use client_disconnect::client_disconnect;
9 | pub use driver_connect::driver_connect;
10 | pub use driver_disconnect::driver_disconnect;
11 | pub use rtp_packet::rtp_packet;
12 | pub use speaking_state_update::speaking_state_update;
13 | pub use voice_tick::{VoiceTickContext, voice_tick};
14 |
--------------------------------------------------------------------------------
/scripty_audio_handler/src/events/rtp_packet.rs:
--------------------------------------------------------------------------------
1 | use serenity::model::id::GuildId;
2 | use songbird::events::context_data::RtpData;
3 |
4 | pub fn rtp_packet(rtp_packet: &RtpData, guild_id: GuildId) {
5 | let rtp_packet = rtp_packet.rtp();
6 | let ssrc = rtp_packet.get_ssrc();
7 | let timestamp = rtp_packet.get_timestamp().0;
8 | let sequence = rtp_packet.get_sequence().0;
9 |
10 | trace!(
11 | %guild_id,
12 | %ssrc,
13 | "debug_log_audio_data: RTP packet data: sequence {}, timestamp {}",
14 | sequence,
15 | timestamp,
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/scripty_automod/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "scripty_automod"
3 | version.workspace = true
4 | edition.workspace = true
5 | license.workspace = true
6 | homepage.workspace = true
7 | repository.workspace = true
8 |
9 | [lints]
10 | workspace = true
11 |
12 | [dependencies]
13 | stfu.workspace = true
14 | sqlx.workspace = true
15 | poise.workspace = true
16 | tracing.workspace = true
17 |
18 | scripty_db = { path = "../scripty_db" }
19 | scripty_premium = { path = "../scripty_premium" }
20 |
--------------------------------------------------------------------------------
/scripty_automod/src/db.rs:
--------------------------------------------------------------------------------
1 | use crate::types::{AutomodRule, AutomodServerConfig};
2 |
3 | pub async fn get_guild_config(guild_id: u64) -> Result