• Guides
  • Api Documentation
Show / Hide Table of Contents
  • Discord.Addons.MpGame
    • CurrentlyPlaying
    • GameBase<TPlayer>
    • IMpGameData
    • MpGameModuleBase<TService, TGame, TPlayer>
    • MpGameService<TGame, TPlayer>
    • MpGameService<TGame, TPlayer>.MpGameData
    • Player
  • Discord.Addons.MpGame.Collections
    • CircularLinkedList<T>
    • Hand<T>
    • IWrapper<T>
    • Node<T>
    • Pile<T>
    • WrappingPile<T, TWrapper>
  • Discord.Addons.Preconditions
    • Measure
    • MinimumOnlineUsersAttribute
    • RatelimitAttribute
    • RatelimitFlags
    • RequireLowerHierarchyAttribute
    • RequireRoleAttribute
    • UserMustBeInVoiceAttribute

Class Player

Represents a Discord user as a Player.

Inheritance
Object
Player
Namespace: Discord.Addons.MpGame
Assembly: Discord.Addons.MpGame.dll
Syntax
public class Player

Constructors

| Improve this Doc View Source

Player(IUser, IMessageChannel)

Creates a Player out of an IUser.

Declaration
public Player(IUser user, IMessageChannel channel)
Parameters
Type Name Description
IUser user

The user represented.

IMessageChannel channel

The channel where this game is played.

Properties

| Improve this Doc View Source

User

The underlying IUser instance.

Declaration
public IUser User { get; }
Property Value
Type Description
IUser

Methods

| Improve this Doc View Source

SendMessageAsync(String, Embed)

Sends a message to this Player's DM Channel and will cache the message if the user has DMs disabled.

Declaration
public async Task<IUserMessage> SendMessageAsync(string text, Embed embed = null)
Parameters
Type Name Description
String text

The text to send.

Embed embed

If provided, an embed to send.

Returns
Type Description
Task<IUserMessage>

The message that is sent, or null if it couldn't be sent.

| Improve this Doc View Source

ShouldKick(Int32)

Can be overriden to determine if a player should be kicked for not having DMs enabled for too long.

Declaration
protected virtual bool ShouldKick(int backstuffedDms)
Parameters
Type Name Description
Int32 backstuffedDms

The amount of DMs that are currently not sent to this player.

Returns
Type Description
Boolean

true if the player should be kicked, otherwise false.

Remarks
note

The default implementation always returns false.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX