Refactor macros
This commit is contained in:
@ -25,7 +25,7 @@ pub trait CtxData {
|
||||
|
||||
async fn channel_data(&self) -> Result<ChannelData, Error>;
|
||||
|
||||
async fn command_macros(&self) -> Result<Vec<CommandMacro<Data, Error>>, Error>;
|
||||
async fn command_macros(&self) -> Result<Vec<CommandMacro>, Error>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -57,7 +57,7 @@ impl CtxData for Context<'_> {
|
||||
ChannelData::from_channel(&channel, &self.data().database).await
|
||||
}
|
||||
|
||||
async fn command_macros(&self) -> Result<Vec<CommandMacro<Data, Error>>, Error> {
|
||||
async fn command_macros(&self) -> Result<Vec<CommandMacro>, Error> {
|
||||
self.data().command_macros(self.guild_id().unwrap()).await
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ impl Data {
|
||||
pub(crate) async fn command_macros(
|
||||
&self,
|
||||
guild_id: GuildId,
|
||||
) -> Result<Vec<CommandMacro<Data, Error>>, Error> {
|
||||
) -> Result<Vec<CommandMacro>, Error> {
|
||||
let rows = sqlx::query!(
|
||||
"SELECT name, description, commands FROM macro WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?)",
|
||||
guild_id.get()
|
||||
|
Reference in New Issue
Block a user