Project

netease_im

0.0
No commit activity in last 3 years
No release in over 3 years
网易IM服务端接口.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 10.0
~> 3.4
 Project Readme

NeteaseIm

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/netease_im. To experiment with that code, run bin/console for an interactive prompt.

NeteaseIM Server SDK in Ruby.

API文档

API接口

User

  • create 创建云信ID
  • update 云信ID更新
  • refresh_token 更新并获取新token
  • block 封禁云信ID
  • unblock 解禁云信ID
  • update_uinfo 更新用户名片
  • get_uinfos 获取用户名片
  • set_donnop 设置桌面端在线时,移动端是否需要推送

ChatRoom

  • create 创建聊天室
  • get 查询聊天室信息
  • update 更新聊天室信息
  • toggle_close_stat 修改聊天室开/关闭状态
  • set_member_role 设置聊天室内用户角色
  • request_addr 请求聊天室地址
  • send_msg 发送聊天室消息
  • add_robot 往聊天室内添加机器人
  • remove_robot 从聊天室内删除机器人
  • temporary_mute 设置临时禁言状态
  • queue_offer 往聊天室有序队列中新加或更新元素
  • queue_poll 从队列中取出元素
  • queue_list 排序列出队列中所有元素
  • queue_drop 删除清理整个队列
  • queue_init 初始化队列
  • mute_room 将聊天室整体禁言
  • topn 查询聊天室统计指标TopN
  • members_by_page 分页获取成员列表
  • query_members 批量获取在线成员信息

Msg

  • send_msg 发送普通消息
  • send_batch_msg 批量发送点对点普通消息
  • send_attach_msg 发送自定义系统通知

History

  • query_session_msg 单聊云端历史消息查询
  • query_team_msg 群聊云端历史消息查询
  • query_chatroom_msg 聊天室云端历史消息查询
  • delete_history_message 删除聊天室云端历史消息
  • query_user_events 用户登录登出事件记录查询

例子

NeteaseIM.app_key = "abc"
NeteaseIM.app_secret = "456"
NeteaseIM.gateway = "https://api.netease.im"

NeteaseIM::User.create(accid: 'test', name: 'test')
NeteaseIM::ChatRoom.create(name: 'test')
NeteaseIM::Msg.send_msg(from: 'test', ope: 0, to: 't2', type: 0, body: {msg: 'hello'})

Installation

Add this line to your application's Gemfile:

gem 'netease_im'

And then execute:

$ bundle

Or install it yourself as:

$ gem install netease_im

Usage

TODO: Write usage instructions here

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/liuliang/netease_im. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.