Skip to content

Instantly share code, notes, and snippets.

@appellation
Last active August 29, 2020 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appellation/d90018dbe84d110d6fb83b1646a92367 to your computer and use it in GitHub Desktop.
Save appellation/d90018dbe84d110d6fb83b1646a92367 to your computer and use it in GitHub Desktop.
let foo = "bar";
export foo;
fn MESSAGE_CREATE(message) {
import "discord" as discord;
import "https://gist.github.com/appellation/d90018dbe84d110d6fb83b1646a92367/raw/84a6fb20ab6d7f893efce9efd8675c3220d7d345/foo.rhai" as foo;
debug(message);
if message.author.has("bot") && message.author.bot {
return;
}
if message.content.index_of("!say") == 0 {
discord::reply(message, foo::foo + message.content.sub_string(4));
} else if message.content == "!smile" {
print(":)");
discord::react(message, "😄");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment