Start(ctx context.Context) | error | User("@me") 或 Session.Open 失敗 |
Close() | error | Session.Close 失敗 |
Status() | Status | |
Reply(handler ReplyHandler) | — | 取代先前的 handler |
Send(ctx, channelID, replyTo, text string) | (*discordgo.Message, error) | 空 channel ID、API 錯誤 |
Delete(ctx, channelID, messageID string) | error | 空 ID、API 錯誤 |
SendFiles(ctx, channelID, replyTo string, paths []string, caption ...string) | (*discordgo.Message, error) | 空 channel ID、路徑為 0 個或超過 10 個、空路徑、os.Open 失敗 |
SendVoice(ctx, channelID, replyTo, path string, caption ...string) | (*discordgo.Message, error) | 空 channel ID 或路徑、os.Open 失敗 |
SendInput(ctx, channelID, replyTo, prompt string) | (*discordgo.Message, error) | 空 channel ID 或 prompt、UUID 失敗 |
SendSelect(ctx, channelID, replyTo, text string, items []string) | (*discordgo.Message, error) | 空 channel ID 或文字、非空項目為 0 個或超過 25 個、UUID 失敗 |
SendMultiSelect(ctx, channelID, replyTo, text string, items []string) | (*discordgo.Message, error) | 同 SendSelect |
SendStatus(ctx, channelID, replyTo, text string, opts ...StatusOption) | error | 立即 flush 時的送出/編輯錯誤 |
FinishStatus(ctx, channelID string) | error | 刪除錯誤,或等待進行中編輯時的 ctx.Err() |
Save(ctx, att *discordgo.MessageAttachment, dir string) | (string, error) | 附件為 nil、URL 或 dir 為空、超過 25 MiB、HTTP 非 200、檔案系統錯誤 |