Skip to content

Latest commit

 

History

History
608 lines (458 loc) · 13.6 KB

Events.md

File metadata and controls

608 lines (458 loc) · 13.6 KB

Amino.Net Events

This is a seperated documentation file written for Amino.Net's Events!

  • This file might not always be up to date right away
  • This file contains every Amino.Net Event nicely wrapped up
  • To see the full general documentation consider reading Readme.md (Click here)
Amino.Net Events
  • This library features a number of events that you can subscribe to!
  • All events run on an Amino.Client() instance!
  • All events will return either a value or an Object.
onMessage

This event fires each time the Client receives a Text message

Event:

  • This event returns an Amino.Objects.Message object

Example:

static void onMessageEvent(Amino.Objects.Message message) 
{
    Console.WriteLine($"User {message.Author.userName} has sent a message: {message.content} in chat: {message.chatId}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onMessage += onMessageEvent;
}

Returns:

  • Amino.Objects.Message
onImageMessage

This event fires each time the Client receives an Image message

Event:

  • This event returns an Amino.Objects.ImageMessage Object

Example:

static void onImageMessageEvent(Amino.Objects.ImageMessage imageMessage) 
{
    Console.WriteLine($"User {imageMessage.Author.nickname} has sent an image: {imageMessage.mediaUrl}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onImageMessage += onImageMessageEvent;
}

Returns:

  • Amino.Objects.ImageMessage
onWebSocketMessage

This event fires each time a websocket message has been recevied by the Client

Event:

  • This event returns a string, that being the raw (probably JSON) websocket message

Example:

static void onWebSocketMessageEvent(string socketMessage) 
{
    Console.WriteLine("Recevied websocket message: " + socketMessage);
}


[...]

static void main(string[] args) 
{
    [...]
    client.onWebSocketMessage += onWebSocketMessageEvent;
}

Returns:

  • string
onYouTubeMessage

This event fires each time a YouTube message has been received by the Client

Event:

  • This event returns an Amino.Objects.YouTubeMessage Object

Example:

static void onYouTubeMessageEvent(Amino.Objects.YouTubeMessage youtubeMessage) 
{
    Console.WriteLine("Video title of the received Video: " + youtubeMessage.videoTitle);
}


[...]

static void main(string[] args) 
{
    [...]
    client.onYouTubeMessage += onYouTubeMessageEvent;
}

Returns:

  • Amino.Objects.YouTubeMessage
onVoiceMessage

This event fires each time a Voice message / note is received by the Client

Event:

  • This event returns an Amino.Objects.VoiceMessage Object

Example:

static void onVoiceMessageEvent(Amino.Objects.VoiceMessage voiceMessage) 
{
    Console.WriteLine("URL to the audio file: " + voiceMessage.mediaValue);
    Console.WriteLine("Duration of the voice message: " + voiceMessage.Extensions.duration);
}


[...]

static void main(string[] args) 
{
    [...]
    client.onVoiceMessage += onVoiceMessageEvent;
}

Returns:

  • Amino.Objects.VoiceMessage
onStickerMessage

This event fires each time an Amino sticker message has been received by the Client

Event:

  • This event returns an Amino.Objects.StickerMessage Object

Example:

static void onStickerMessageEvent(Amino.Objects.StickerMessage stickerMessage)
{
    Console.WriteLine("Sticker ID: " + stickerMessage.Sticker.stickerId);
}


[...]

static void main(string[] args) 
{
    [...]
    client.onStickerMessage += onStickerMessageEvent;
}

Returns:

  • Amino.Objects.StickerMessage
onMessageDeleted

This event fires each time an Amino message has been deleted in any chat where the current Amino account is in

Event:

  • This even returns an Amino.Objects.DeletedMessage Object

Example:

static void onDeletedMessageEvent(Amino.Objects.DeletedMessage deletedMessage)
{
    Console.WriteLine($"User: {deletedMessage.Author.username}({deletedMessage.Author.userId}) has deleted a message in chat: {deletedMessage.chatId}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onMessageDeleted += onStickerMessageEvent;
}

Returns:

  • Amino.Objects.DeletedMessage
onChatMemberJoin

This event fires each time an Amino user has joined a chat thread where the current Amino account is in

Event:

  • This event returns an Amino.Obejcts.JoinedChatMember Object

Example:

static void onUserChatJoinEvent(Amino.Objects.JoinedChatMember joinedMember)
{
    Console.WriteLine($"User: {joinedMember.Author.nickname} joined chat {joinedMember.chatId}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatMemberJoin += onUserChatJoinEvent;
}

Returns:

  • Amino.Objects.JoinedChatMember
onChatMemberLeave

This even fires each time an Amino user has left a chat where the current Amino account is in

Event:

  • This event returns an Amino.Objects.LeftChatMember Object

Example:

static void onUserChatLeaveEvent(Amino.Objects.LeftChatMember leftMember)
{
    Console.WriteLine($"User: {leftMember.userId} left chat {leftMember.chatId}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatMemberLeave += onUserChatLeaveEvent;
}

Returns:

  • Amino.Objects.LeftChatMember
onChatBackgroundChanged

This event fires each time an Amino chat thread background has been changed (only chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatEvent Object

Example:

static void onChatBackgroundChangedEvent(Amino.Objects.ChatEvent chatEvent)
{
    Console.WriteLine($"Background in Chat thread {chatEvent.chatId} has changed.");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatBackgroundChanged += onChatBackgroundChangedEvent;
}

Returns:

  • Amino.Objects.ChatEvent
onChatTitleChanged

This event fires each time an Amino chat thread Title has been changed (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatEvent Object

Example:

static void onChatTitleChangedEvent(Amino.Objects.ChatEvent chatEvent)
{
    Console.WriteLine($"Title of Chat thread {chatEvent.chatId} has changed.");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatTitleChanged += onChatTitleChangedEvent;
}

Returns:

  • Amino.Objects.ChatEvent
onChatContentChanged

This event fires each time an Amino chat thread Content (Description) has been changed (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatEvent Object

Example:

static void onChatContentChangedEvent(Amino.Objects.ChatEvent chatEvent)
{
    Console.WriteLine($"Content of Chat thread {chatEvent.chatId} has changed.");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatContentChanged += onChatContentChangedEvent;
}

Returns:

  • Amino.Objects.ChatEvent
onChatAnnouncementPin

This event fires each time an Amino chat Announcement has been pinned / changed (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatAnnouncement Object

Example:

static void onChatAnnouncementChangedEvent(Amino.Objects.ChatAnnouncement chatAnnouncement)
{
    Console.WriteLine($"Chat Announcement of Chat thread {chatAnnouncement.chatId} has changed to {chatAnnouncement.content}.");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatAnnouncementPin += onChatAnnouncementChangedEvent;
}

Returns:

  • Amino.Objects.ChatAnnouncement
onChatAnnouncementUnPin

This event fires each time an Amino chat Announcement has been unpinned / removed (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatEvent Object

Example:

static void onChatAnnouncementRemovedEvent(Amino.Objects.ChatEvent chatEvent)
{
    Console.WriteLine($"Chat Announcement of Chat thread {chatEvent.chatId} has been removed.");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatAnnouncementUnPin += onChatAnnouncementRemovedEvent;
}

Returns:

  • Amino.Objects.ChatEvent
onChatViewModeOn

This event fires each time an Amino chat has been put on ViewMode (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ViewMode Object

Example:

static void onChatViewModeToggle(Amino.Objects.ViewMode viewMode)
{
    Console.WriteLine($"Chat {viewMode.chatId} got put into ViewMode by {viewMode.Author.nickname}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatViewModeOn += onChatViewModeToggle;
}

Returns:

  • Amino.Objects.ViewMode
onChatViewModeOff

This event fires each time an Amino chat has been put out of ViewMode (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ViewMode Object

Example:

static void onChatViewModeToggle(Amino.Objects.ViewMode viewMode)
{
    Console.WriteLine($"Chat {viewMode.chatId} got put out of ViewMode by {viewMode.Author.nickname}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatViewModeOff += onChatViewModeToggle;
}

Returns:

  • Amino.Objects.ViewMode
onChatTipEnabled

This event fires each time an Amino chat has enabled Chat Tipping (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.chatTipToggle Object

Example:

static void onChatTipToggle(Amino.Objects.ChatTipToggle chatTipToggle)
{
    Console.WriteLine($"Chat {chatTipToggle.chatId} has enabled tipping");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatTipEnabled += onChatTipToggle;
}

Returns:

  • Amino.Objects.ChatTipToggle
onChatTipDisabled

This event fires each time an Amino chat has disabled Chat Tipping (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.chatTipToggle Object

Example:

static void onChatTipToggle(Amino.Objects.ChatTipToggle chatTipToggle)
{
    Console.WriteLine($"Chat {chatTipToggle.chatId} has disabled tipping");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatTipDisabled += onChatTipToggle;
}

Returns:

  • Amino.Objects.ChatTipToggle
onMessageForceRemovedByAdmin

This event fires each time an Amino chat message has been removed by an admin (only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.SpecialChatEvent Object

Example:

static void onMesssageRemoved(Amino.Objects.SpecialChatEvent specialChatEvent)
{
    Console.WriteLine($"Message {specialChatEvent.messageId} has been removed on chat {specialChatEvent.chatId} by {specialChatEvent.Author.nickname}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onMessageForceRemovedByAdmins += onChatMessageRemoved;
}

Returns:

  • Amino.Objects.SpecialChatEvent
onChatTip

This event fires each time an Amino user has given a chat tip(only for chats where the current Amino account is in)

Event:

  • This event returns an Amino.Objects.ChatTip Object

Example:

static void chatTip(Amino.Objects.ChatTip tip)
{
    Console.WriteLine($"User {tip.Author.nickname} has tipped {tip.Extensions.tippedCoins} Coins in chat {tip.chatId}");
}


[...]

static void main(string[] args) 
{
    [...]
    client.onChatTip += chatTip;
}

Returns:

  • Amino.Objects.ChatTip