Skip to content

Commit

Permalink
Deprecate the standard framework (serenity-rs#2733)
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev authored Jan 22, 2024
1 parent 521de49 commit 7baa1c7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy --workspace --tests -- -D warnings
run: cargo clippy --workspace --tests -- -D warnings --cfg ignore_serenity_deprecated

rustfmt:
name: Format
Expand Down
1 change: 1 addition & 0 deletions examples/e05_command_framework/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! git = "https://github.com/serenity-rs/serenity.git"
//! features = ["framework", "standard_framework"]
//! ```
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.
use std::collections::{HashMap, HashSet};
use std::env;
use std::fmt::Write;
Expand Down
1 change: 1 addition & 0 deletions examples/e06_sample_bot_structure/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! git = "https://github.com/serenity-rs/serenity.git"
//! features = ["framework", "standard_framework"]
//! ```
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.
mod commands;

use std::collections::HashSet;
Expand Down
2 changes: 2 additions & 0 deletions examples/e07_env_logging/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.

use std::env;

use serenity::async_trait;
Expand Down
1 change: 1 addition & 0 deletions examples/e10_collectors/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! This example will showcase the beauty of collectors. They allow to await messages or reactions
//! from a user in the middle of a control flow, one being a command.
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.
use std::collections::HashSet;
use std::env;
use std::time::Duration;
Expand Down
1 change: 1 addition & 0 deletions examples/e12_global_data/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! In this example, you will be shown various ways of sharing data between events and commands.
//! And how to use locks correctly to avoid deadlocking the bot.
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.

use std::collections::HashMap;
use std::env;
Expand Down
1 change: 1 addition & 0 deletions examples/e15_simple_dashboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! Example 7 is needed because tracing is being used.
//! Example 12 is needed because global data and atomic are used.
//! Example 13 is needed for the parallel loops that are running to update data from the dashboard.
#![allow(deprecated)] // We recommend migrating to poise, instead of using the standard command framework.

// be lazy, import all macros globally!
#[macro_use]
Expand Down
1 change: 1 addition & 0 deletions src/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub mod standard;
use async_trait::async_trait;

#[cfg(feature = "standard_framework")]
#[allow(deprecated)]
pub use self::standard::StandardFramework;
use crate::client::{Client, Context, FullEvent};

Expand Down
5 changes: 5 additions & 0 deletions src/framework/standard/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![cfg_attr(
not(ignore_serenity_deprecated),
deprecated = "The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling"
)]

pub mod help_commands;
pub mod macros {
pub use command_attr::{check, command, group, help, hook};
Expand Down

0 comments on commit 7baa1c7

Please sign in to comment.