This is sample for implement BOT in LINE group
        Invite your BOT to group, then BOT will auto accept your invitation
        Command availabe :
        > hi
        > /author
13364
def RECEIVE_MESSAGE(op):
    '''
        
    '''
    msg = op.message
    
    text = msg.text
    msg_id = msg.id
    receiver = msg.to
    sender = msg._from
    
    try:
        # Check content only text message
        if msg.contentType == 0:
            # Check only group chat
            if msg.toType == 2:
                # Chat checked request
                line.sendChatChecked(receiver, msg_id)
                # Get sender contact
                contact = line.getContact(sender)
                # Command list
                if text.lower() == 'hi':
                    line.log('[%s] %s' % (contact.displayName, text))
                    line.sendMessage(receiver, 'Hi too! How are you?')
                elif text.lower() == '/author':
                    line.log('[%s] %s' % (contact.displayName, text))
                    line.sendMessage(receiver, 'My author is linepy')
    except Exception as e:
        line.log("[RECEIVE_MESSAGE] ERROR : " + str(e))
11740
def put(self, request, bot_id, id, format=None):
              
        return super(TelegramBotDetail, self).put(request, bot_id, id, format)
798158
def go(self, settings, command):
        
        bot = TwitterBot(settings)

        result = 1
        if command == 'post_message':
            result = bot.post_message()
        elif command == 'reply_to_mentions':
            result = bot.reply_to_mentions()
        else:
            print("Command must be either 'post_message' or 'reply_to_mentions'")

        return result
1026682
def channels_invite(self, room_id, user_id, **kwargs):
        """"""
        return self.__call_api_post('channels.invite', roomId=room_id, userId=user_id, kwargs=kwargs)
986798
def invite(body)
      raise ArgumentError unless body.is_a?(Array)
      raise ArgumentError unless body.first.is_a?(Hash)
      api.post('invite', body, 'application/json')
    end
1093553
function createBot() {
  var bot = function(platform, context, event, next) {
    context.platform = platform;
    bot.handle(context, event, next);
  };

  mixin(bot, EventEmitter.prototype, false);
  mixin(bot, proto, false);

  bot.context = { __proto__: context, bot: bot };
  bot.event = { __proto__: event, bot: bot };
  bot.display_name = "bot"; // default, should be overwritten
  bot.init();
  return bot;
}
486089
def send(to, message, **kwargs):
    

    available_kwargs_keys = [
        'parse_mode',
        'disable_web_page_preview',
        'disable_notification',
        'reply_to_message_id',
        'reply_markup'
    ]

    available_kwargs = {
        k: v for k, v in kwargs.iteritems() if k in available_kwargs_keys
    }

    bot = telepot.Bot(settings.TELEGRAM_BOT_TOKEN)
    return bot.sendMessage(to, message, **available_kwargs)
399473
def post(self, request, bot_id, format=None):
        
        return super(KikChatStateList, self).post(request, bot_id, format)
1199263
function(eventEmitter, access_token, group_id, picture_url) {

  API.Bots.create(
    access_token,
    "TestBot_PictureText",
    group_id,
    {avatar_url:"https://secure.gravatar.com/avatar/0ea0a27ab0e9a49b753cd2e3c27e585d?s=420&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"},
    function(err,ret) {
      if (err) {
        eventEmitter.emit('error', err);
      } else {
        eventEmitter.emit('success', ret);
      }
    });

  eventEmitter.emit('start');

  return eventEmitter;

}
878810
def run(self, invite_id, **kwargs):
        
        self.l = self.get_logger(**kwargs)
        self.l.info("Looking up the invite")
        invite = Invite.objects.get(id=invite_id)
        msg_payload = self.compile_msg_payload(invite)
        result = self.send_message(msg_payload)
        self.l.info("Creating task to update invite after send")
        post_send_update_invite.apply_async(args=[invite_id])
        self.l.info("Created task to update invite after send")
        return "Message queued for send. ID: <%s>" % str(result["id"])
554774
function parseEntityBotCommand(text, entity) {
    let result = RE_BOT_COMMAND.exec(text.substr(
        entity.offset,
        entity.length
    ));

    return {
        type: entity.type,
        name: result[1],
        mention: result[2],
    };
}
486337
def invite(self, group_name, user):
        
        group_id = self.get_group_id(group_name)
        self.params.update({
            'channel': group_id,
            'user':    user,
            })
        return FromUrl('https://slack.com/api/groups.invite', self._requests)(data=self.params)
386222
def put(self, request, bot_id, id, format=None):
              
        return super(HookDetail, self).put(request, bot_id, id, format)
495248
def add_users(self, category):
        """"""
        mapping = {'banned': 'ban', 'contributor': 'make_contributor',
                   'moderator': 'make_moderator'}

        if category not in mapping:
            print('{!r} is not a valid option for --add'.format(category))
            return
        func = getattr(self.sub, mapping[category])
        print('Enter user names (any separation should suffice):')
        data = sys.stdin.read().strip()
        for name in re.split('[^A-Za-z0-9_]+', data):
            func(name)
            print('Added {!r} to {}'.format(name, category))
1313388
def message_user(self, username, domain, subject, message):
        """"""
        jid = '%s@%s' % (username, domain)
        if self.api_version <= (14, 7):
            # TODO: it's unclear when send_message was introduced
            command = 'send_message_chat'
            args = domain, '%s@%s' % (username, domain), message
        else:
            command = 'send_message'
            args = 'chat', domain, jid, subject, message

        code, out, err = self.ctl(command, *args)
        if code != 0:
            raise BackendError(code)
558131
def groups_invite(self, room_id, user_id, **kwargs):
        """"""
        return self.__call_api_post('groups.invite', roomId=room_id, userId=user_id, kwargs=kwargs)
994771
def groups_invite(self, *, channel: str, user: str, **kwargs) -> SlackResponse:
        
        self._validate_xoxp_token()
        kwargs.update({"channel": channel, "user": user})
        return self.api_call("groups.invite", json=kwargs)