Exemplo n.º 1
0
 //キャンセルが出た時
 private async void cancelEventFromService(object sender, EventArgs e)
 {
     if (e is ReceiveData)
     {
         ReceiveData data = e as ReceiveData;
         if (joinDatabase.isJoinable())
         {
             joinDatabase.cancelMember(data.Author);
             await postService.AsyncPostService(string.Format("{0}のエントリーをキャンセルしました。", data.Author));
         }
         else
         {
             await postService.AsyncPostService("現在エントリーの期間外です。");
         }
     }
 }
Exemplo n.º 2
0
        //emgServiceから問い合わせが来た時のイベント
        public void OrderReplay(object sender, EventArgs e)
        {
            if (e is ReceiveData)
            {
                ReceiveData d = e as ReceiveData;

                if (d.content == "今日の緊急" || d.content == "緊急")
                {
                    todayEmgOrder?.Invoke(sender, d);
                }

                if (d.content == "明日の緊急")
                {
                    tomorrowEmgOrder?.Invoke(sender, d);
                }
            }
        }
Exemplo n.º 3
0
        //Discordにリプライがきたときのイベント
        private void replayEvent(object sender, EventArgs e)
        {
            if (e is ReceiveData)
            {
                ReceiveData data    = e as ReceiveData;
                bool        isOrder = false;

                foreach (string s in orderwords)
                {
                    if (data.content.Contains(s))
                    {
                        isOrder = true;
                    }
                }

                // bool isfillter = fillter(data.content);

                if (isOrder)    //問い合わせワードが含まれていたら
                {
                    OrderEmg?.Invoke(this, data);
                }
            }
        }
 protected void RunReplayEvent(object sender, ReceiveData data)
 {
     ReceiveReplay?.Invoke(sender, data);
 }
        private void replayEvent(object sender, EventArgs e)
        {
            if (e is ReceiveData)
            {
                ReceiveData data = e as ReceiveData;

                bool isReplay = isWord(data.content);

                if (isReplay == false)
                {
                    return;
                }

                switch (data.content)
                {
                case "33-4":
                    service.PostAsync("なんでや!阪神関係ないやろ!");
                    return;

                case "アアアッ":
                    service.PostAsync("レグザフォン");
                    return;

                case "まるめし":
                    service.PostAsync("まるめしはあっち");
                    return;

                case "変態":
                    service.PostAsync("変態はあっち");
                    return;

                case "今日の天気":
                    service.PostAsync("自分で調べろ");
                    return;

                case "明日の天気":
                    service.PostAsync("自分で調べろ");
                    return;

                case "おっぱい":
                    service.PostAsync("揉んでみたいよな");
                    return;

                case "ちんぽ":
                    service.PostAsync("ボロン");
                    return;

                case "Hey Siri":
                    service.PostAsync("OK Google");
                    return;

                case "OK Google":
                    service.PostAsync("Hey Siri");
                    return;

                default:
                    service.PostAsync(randomWord());
                    return;
                }
            }
        }