utility

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCardMessageCols added in v0.0.5

func BuildCardMessageCols(titleK, titleV string, kvMap map[string]interface{}) (res []interface{}, err error)

BuildCardMessageCols 创建卡片消息的列

func ForDebug

func ForDebug(test ...interface{})

ForDebug 用于测试

func GetChannnelInfo added in v0.0.5

func GetChannnelInfo(channelID string) (channelInfo *khl.Channel, err error)

GetChannnelInfo 获取频道信息

@param channelID
@return channelInfo
@return err

func GetCurrentTime

func GetCurrentTime() (localTime string)

GetCurrentTime 获取当前时间

func GetGuildInfo added in v0.0.5

func GetGuildInfo(guildID string) (guildInfo *khl.Guild, err error)

GetGuildInfo 获取公会信息

@param guildID
@return guildInfo
@return err

func GetOutBoundIP

func GetOutBoundIP() (ip string, err error)

GetOutBoundIP 获取机器人部署的当前ip

func GetUserInfo added in v0.0.5

func GetUserInfo(userID, guildID string) (userInfo *khl.User, err error)

GetUserInfo 获取用户信息

@param userID
@param guildID
@return userInfo

func IsInSlice

func IsInSlice(target string, slice []string) bool

IsInSlice 判断机器人是否被at到

@param target
@param slice
@return bool

func MustAtoI added in v0.0.5

func MustAtoI(str string) int

MustAtoI 将字符串转换为int

@param str
@return int

func Struct2Map added in v0.0.5

func Struct2Map(obj interface{}) map[string]interface{}

Struct2Map 将结构体转换为map

@param obj
@return map

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL