예제 #1
0
        public static void doRemovalDoubt(long user, long mid, long groupID, GroupConfigurationObject GCO, long jmid)
        {
            int ra = 0;

            SQL.NonQuery($"DELETE FROM `verify` WHERE `user`={user} AND `group`={groupID}", out ra);
            SQL.NonQuery($"INSERT INTO `verify_doubt` (`user`,`group`) VALUES({user},{groupID})", out ra);
            Removals.addIncident(new TGUser()
            {
                id = user
            }, new TGChat {
                id = groupID
            }, "VERIFYEXPIRE");
            root.callHook.Call("verUserRemoved", user, mid, groupID, GCO, true);
            var thc = new TGChat()
            {
                id = groupID
            };
            var thu = new TGUser()
            {
                id = user
            };
            var thm = Telegram.getChatMember(thc, thu);

            if (mid != 0)
            {
                Telegram.deleteMessage(thc, mid);
            }
            if (jmid != 0)
            {
                Telegram.deleteMessage(thc, jmid);
            }
            Telegram.kickChatMember(thc, thu, 120);
            if (GCO.getBool("verifyannounce"))
            {
                var name    = Helpers.getMentionName(thm);
                var sendMsg = Localization.getStringLocalized(GCO.getString("language"), "verify/userKickedDoubt", name);
                var msg     = Telegram.sendMessage(new TGChat()
                {
                    id = groupID
                }, sendMsg);
                Cleanup.addMessage(msg);
            }
        }
예제 #2
0
        public static void doRemoval(long user, long mid, long groupID, GroupConfigurationObject GCO, long jmid)
        {
            int ra = 0;

            Removals.addIncident(new TGUser()
            {
                id = user
            }, new TGChat {
                id = groupID
            }, "VERIFYEXPIRE");
            SQL.NonQuery($"DELETE FROM `verify` WHERE `user`={user} AND `group`={groupID}", out ra);
            root.callHook.Call("verUserRemoved", user, mid, groupID, GCO, false);
            var thc = new TGChat()
            {
                id = groupID
            };
            var thu = new TGUser()
            {
                id = user
            };
            var thm = Telegram.getChatMember(thc, thu);

            if (mid != 0)
            {
                Telegram.deleteMessage(thc, mid);
            }
            if (jmid != 0)
            {
                Telegram.deleteMessage(thc, jmid);
            }
            Telegram.kickChatMember(thc, thu, 0);
            //Telegram.sendMessage(thc, "welcome to kicked, nobody will ever know you existed.");
            if (GCO.getBool("verifyannounce"))
            {
                var name    = Helpers.getMentionName(thm);
                var sendMsg = Localization.getStringLocalized(GCO.getString("language"), "verify/userKicked", name);
                var msg     = Telegram.sendMessage(new TGChat()
                {
                    id = groupID
                }, sendMsg);
                Cleanup.addMessage(msg);
            }
        }