Add patreon-sharing option

This commit is contained in:
jude
2025-10-04 18:09:31 +01:00
parent 5ae4baa2a6
commit 91310d47d3
11 changed files with 232 additions and 30 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ pub enum RecordedCommand {
#[serde(rename = "delete")]
Delete(crate::commands::delete::Options),
#[serde(rename = "donate")]
Donate(crate::commands::donate::Options),
Donate(crate::commands::patreon::info::Options),
#[serde(rename = "help")]
Help(crate::commands::help::Options),
#[serde(rename = "info")]
@@ -111,7 +111,7 @@ impl RecordedCommand {
"clock" => Some(Self::Clock(crate::commands::clock::Options::extract(ctx))),
"dashboard" => Some(Self::Dashboard(crate::commands::dashboard::Options::extract(ctx))),
"delete" => Some(Self::Delete(crate::commands::delete::Options::extract(ctx))),
"donate" => Some(Self::Donate(crate::commands::donate::Options::extract(ctx))),
"donate" => Some(Self::Donate(crate::commands::patreon::info::Options::extract(ctx))),
"help" => Some(Self::Help(crate::commands::help::Options::extract(ctx))),
"info" => Some(Self::Info(crate::commands::info::Options::extract(ctx))),
"look" => Some(Self::Look(crate::commands::look::Options::extract(ctx))),
+2 -5
View File
@@ -17,7 +17,7 @@ use crate::{
CtxData,
},
time_parser::{cron_next_timestamp, natural_parser},
utils::{check_guild_subscription, check_subscription},
utils::check_subscription,
Context, Database, Error,
};
use chrono::{DateTime, NaiveDateTime, Utc};
@@ -532,10 +532,7 @@ pub async fn create_reminder(
};
let (processed_interval, processed_expires) = if let Some(repeat) = &interval {
if check_subscription(&ctx, ctx.author().id).await
|| (ctx.guild_id().is_some()
&& check_guild_subscription(&ctx, ctx.guild_id().unwrap()).await)
{
if check_subscription(&ctx, ctx.author().id, ctx.guild_id()).await {
(
parse_duration(repeat)
.or_else(|_| parse_duration(&format!("1 {}", repeat)))