diff --git a/Onequestionmark.hx b/Onequestionmark.hx index 702bbb2..ec280d3 100644 --- a/Onequestionmark.hx +++ b/Onequestionmark.hx @@ -9,6 +9,8 @@ using StringTools; class Onequestionmark { static var Bot:DiscordClient; static var settings:Dynamic; + static var botInfo:Dynamic; + static var iceRegex:EReg = ~/\bicc?ed?\b/i; static function main() { @@ -27,6 +29,7 @@ class Onequestionmark { Bot = new DiscordClient(settings.token, [3276799], settings.debug); Bot.onReady = onReady; Bot.onMessageCreate = onMessageCreate; + botInfo = Endpoints.getCurrentUser(); } public static function onReady() { @@ -103,6 +106,7 @@ class Onequestionmark { // Non-command responses if ((msg.charAt(0) == ".") && (msg.length == 1)) {m.reply({content:"omg a meteor"}, true);} + if ((iceRegex.match(msg)) && (m.author.id != botInfo.id)) {m.reply({content:"Did some carbon-based lifeform just say **I C E**?"});} } }