arikawa

package
v0.0.0-...-addf1bc Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package arikawa provides functions and types to convert Arikawa types into darchive types, and vice versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachmentToDarchive

func AttachmentToDarchive(a discord.Attachment) darchive.Attachment

AttachmentToDarchive converts a discord.Attachment to a darchive.Attachment

func ChannelToDarchive

func ChannelToDarchive(ch discord.Channel) darchive.Channel

ChannelToDarchive converts a discord.Channel to a darchive.Channel

func ChannelsToDarchive

func ChannelsToDarchive(chs []discord.Channel) []darchive.Channel

ChannelsToDarchive converts a []discord.Channel to a []darchive.Channel

func EmbedToDarchive

func EmbedToDarchive(e discord.Embed) darchive.Embed

EmbedToDarchive converts a discord.Embed to a darchive.Embed

func EmojiToDarchive

func EmojiToDarchive(e discord.Emoji) darchive.Emoji

EmojiToDarchive converts a discord.Emoji to a darchive.Emoji

func GuildToDarchive

func GuildToDarchive(g discord.Guild) darchive.Guild

GuildToDarchive converts a discord.Guild to a darchive.Guild. Note that you will have to set g.Roles and g.Channels manually using RolesToDarchive and ChannelsToDarchive.

func ReactionToDarchive

func ReactionToDarchive(r discord.Reaction) darchive.Reaction

ReactionToDarchive converts a discord.Reaction to a darchive.Reaction

func RoleToDarchive

func RoleToDarchive(r discord.Role) darchive.Role

RoleToDarchive converts a discord.Role to a darchive.Role

func RolesToDarchive

func RolesToDarchive(rls []discord.Role) []darchive.Role

RolesToDarchive converts a []discord.Role to a []darchive.Role

func UserToDarchive

func UserToDarchive(u discord.User) darchive.User

UserToDarchive converts a discord.User to a darchive.User

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter is a struct to convert Arikawa messages to darchive messages. A zero-value Converter is a valid Converter. A Converter should not be reused after c.Build() is called, unless c.Reset() is then called. A Converter should only be used for a single guild before being reset.

func (*Converter) AddChannel

func (c *Converter) AddChannel(id discord.ChannelID, msgs []discord.Message)

AddChannel adds a channel to the converter.

func (*Converter) Build

func (c *Converter) Build() (map[uint64]darchive.User, map[darchive.Snowflake][]darchive.Message)

Build returns a complete map of users and channels from the converter.

func (*Converter) Reset

func (c *Converter) Reset()

Reset resets c, allowing it to be reused for a fresh set of messages.

Jump to

Keyboard shortcuts

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