currency

package
v0.0.0-...-340dc28 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlterUsersCurrency

func AlterUsersCurrency(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context, multiplier float64)

AlterUsersCurrency will parse through ds, and mc to get a value from the message and then make a change to the mentioned user. The value will be multiplied with the multipier to allow both positive and negative changes.

func AwardCurrency

func AwardCurrency(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context)

AwardCurrency will create a given amount of currency and give it to the user mentioned Should only be used by Bot admins

func ChangeValue

func ChangeValue(db *sql.DB, currencyDelta int, targetUserID string)

ChangeValue will alter the targetUserID's wallet by currencyDelta on the database pointed to by db

func CheckForCurrency

func CheckForCurrency(db *sql.DB, targetUserID string) (int, error)

CheckForCurrency will query the database and return the value of the targetUserID's wallet If that user is not in the database they will be added and given the starting amount of currency

func GiveCurrency

func GiveCurrency(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context)

GiveCurrency will give a given amount of currency from the author of the message to the user who is mentioned. TODO Read the transaction value from message

func ListUserWallet

func ListUserWallet(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context)

ListUserWallet will list the current value of the users wallet.h

func ShowLeaderBoard

func ShowLeaderBoard(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context)

ShowLeaderBoard will display the leaderboard in chat *lb <page>

func TakeCurrency

func TakeCurrency(ds *discordgo.Session, mc *discordgo.Message, ctx *framework.Context)

TakeCurrency will create a given amount of currency and give it to the user mentioned Should only be used by Bot admins

Types

This section is empty.

Jump to

Keyboard shortcuts

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