ctxext

package
v0.0.0-...-78a83f1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: GPL-3.0 Imports: 10 Imported by: 83

Documentation

Overview

Package ctxext zb context 扩展

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoOnceOnSuccess

func DoOnceOnSuccess[Ctx any](f func(Ctx) bool) func(Ctx) bool

DoOnceOnSuccess 当返回 true, 之后直接通过, 否则下次触发仍会执行

func JiebaSimilarity

func JiebaSimilarity[Ctx any](sameper float64, seg *jieba.Segmenter, getmsg func(Ctx) string, src ...string) func(Ctx) bool

JiebaSimilarity sameper from 0.0 to 1.0

func RandSenderPerDayN

func RandSenderPerDayN(uid int64, n int) int

RandSenderPerDayN 每个用户每天随机数

func ValueInList

func ValueInList[Ctx any](getval func(Ctx) string, list ListGetter) func(Ctx) bool

ValueInList 判断参数是否在列表中

Types

type ListGetter

type ListGetter interface {
	List() []string
}

ListGetter 获得实时刷新的 list

Jump to

Keyboard shortcuts

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