Productivity bot for Discord
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

36 lines
656B

  1. extern crate serenity;
  2. use serenity::{
  3. model::channel::Message,
  4. prelude::*,
  5. utils::MessageBuilder,
  6. };
  7. extern crate json;
  8. extern crate regex;
  9. use regex::Regex;
  10. use crate::traits::Command;
  11. pub struct CmdMacro {}
  12. impl Command for CmdMacro {
  13. fn execute(&self, ctx: &Context, msg: &Message) {
  14. let response = MessageBuilder::new()
  15. .push("Hello World")
  16. .build();
  17. msg.channel_id.say(&ctx.http, &response);
  18. }
  19. fn valid(&self, ctx: &Context, msg: &Message) -> bool {
  20. return msg.content == "macro";
  21. }
  22. }
  23. impl CmdMacro {
  24. pub fn new() -> CmdMacro{
  25. return CmdMacro{};
  26. }
  27. }