Restyle to work on most screen sizes
This commit is contained in:
@ -118,6 +118,37 @@ pub struct EmbedField {
|
||||
inline: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ReminderCreate {
|
||||
#[serde(with = "base64s")]
|
||||
attachment: Option<Vec<u8>>,
|
||||
attachment_name: Option<String>,
|
||||
avatar: Option<String>,
|
||||
channel: u64,
|
||||
content: String,
|
||||
embed_author: String,
|
||||
embed_author_url: Option<String>,
|
||||
embed_color: u32,
|
||||
embed_description: String,
|
||||
embed_footer: String,
|
||||
embed_footer_url: Option<String>,
|
||||
embed_image_url: Option<String>,
|
||||
embed_thumbnail_url: Option<String>,
|
||||
embed_title: String,
|
||||
embed_fields: Option<Json<Vec<EmbedField>>>,
|
||||
enabled: bool,
|
||||
expires: Option<NaiveDateTime>,
|
||||
interval_seconds: Option<u32>,
|
||||
interval_days: Option<u32>,
|
||||
interval_months: Option<u32>,
|
||||
#[serde(default = "name_default")]
|
||||
name: String,
|
||||
restartable: bool,
|
||||
tts: bool,
|
||||
username: Option<String>,
|
||||
utc_time: NaiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Reminder {
|
||||
#[serde(with = "base64s")]
|
||||
@ -383,7 +414,7 @@ pub async fn create_reminder(
|
||||
pool: impl sqlx::Executor<'_, Database = Database> + Copy,
|
||||
guild_id: GuildId,
|
||||
user_id: UserId,
|
||||
reminder: Reminder,
|
||||
reminder: ReminderCreate,
|
||||
) -> JsonResult {
|
||||
// check guild in db
|
||||
match sqlx::query!("SELECT 1 as A FROM guilds WHERE guild = ?", guild_id.0)
|
||||
@ -403,7 +434,7 @@ pub async fn create_reminder(
|
||||
}
|
||||
|
||||
// validate channel
|
||||
let channel = reminder.channel.map(|c| ChannelId(c).to_channel_cached(&ctx)).flatten();
|
||||
let channel = ChannelId(reminder.channel).to_channel_cached(&ctx);
|
||||
let channel_exists = channel.is_some();
|
||||
|
||||
let channel_matches_guild =
|
||||
@ -418,7 +449,7 @@ pub async fn create_reminder(
|
||||
return Err(json!({"error": "Channel not found"}));
|
||||
}
|
||||
|
||||
let channel = create_database_channel(&ctx, ChannelId(reminder.channel.unwrap()), pool).await;
|
||||
let channel = create_database_channel(&ctx, ChannelId(reminder.channel), pool).await;
|
||||
|
||||
if let Err(e) = channel {
|
||||
warn!("`create_database_channel` returned an error code: {:?}", e);
|
||||
|
Reference in New Issue
Block a user