Dalamud/docs/api/Discord.MessageExtensions.html
2020-03-24 03:22:08 +09:00

359 lines
16 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class MessageExtensions
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class MessageExtensions
">
<meta name="generator" content="docfx 2.48.1.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Discord.MessageExtensions">
<h1 id="Discord_MessageExtensions" data-uid="Discord.MessageExtensions" class="text-break">Class MessageExtensions
</h1>
<div class="markdown level0 summary"><p>Provides extension methods for <a class="xref" href="Discord.IMessage.html">IMessage</a>.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">MessageExtensions</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Discord.html">Discord</a></h6>
<h6><strong>Assembly</strong>: Discord.Net.Core.dll</h6>
<h5 id="Discord_MessageExtensions_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class MessageExtensions</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/dev/apiSpec/new?filename=Discord_MessageExtensions_AddReactionsAsync_Discord_IUserMessage_Discord_IEmote___Discord_RequestOptions_.md&amp;value=---%0Auid%3A%20Discord.MessageExtensions.AddReactionsAsync(Discord.IUserMessage%2CDiscord.IEmote%5B%5D%2CDiscord.RequestOptions)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/dev/src/Discord.Net.Core/Extensions/MessageExtensions.cs/#L44">View Source</a>
</span>
<a id="Discord_MessageExtensions_AddReactionsAsync_" data-uid="Discord.MessageExtensions.AddReactionsAsync*"></a>
<h4 id="Discord_MessageExtensions_AddReactionsAsync_Discord_IUserMessage_Discord_IEmote___Discord_RequestOptions_" data-uid="Discord.MessageExtensions.AddReactionsAsync(Discord.IUserMessage,Discord.IEmote[],Discord.RequestOptions)">AddReactionsAsync(IUserMessage, IEmote[], RequestOptions)</h4>
<div class="markdown level1 summary"><p>Add multiple reactions to a message.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Task AddReactionsAsync(this IUserMessage msg, IEmote[] reactions, RequestOptions options = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Discord.IUserMessage.html">IUserMessage</a></td>
<td><span class="parametername">msg</span></td>
<td><p>The message to add reactions to.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Discord.IEmote.html">IEmote</a>[]</td>
<td><span class="parametername">reactions</span></td>
<td><p>An array of reactions to add to the message</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Discord.RequestOptions.html">RequestOptions</a></td>
<td><span class="parametername">options</span></td>
<td><p>The options to be used when sending the request.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span></td>
<td><p>A task that represents the asynchronous operation for adding a reaction to this message.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Discord_MessageExtensions_AddReactionsAsync_Discord_IUserMessage_Discord_IEmote___Discord_RequestOptions__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method does not bulk add reactions! It will send a request for each reaction inculded.</p>
</div>
<h5 id="Discord_MessageExtensions_AddReactionsAsync_Discord_IUserMessage_Discord_IEmote___Discord_RequestOptions__examples">Examples</h5>
<pre><code class="lang-cs">IEmote A = new Emoji(&quot;🅰&quot;);
IEmote B = new Emoji(&quot;🅱&quot;);
await msg.AddReactionsAsync(new[] { A, B });</code></pre>
<h5 id="Discord_MessageExtensions_AddReactionsAsync_Discord_IUserMessage_Discord_IEmote___Discord_RequestOptions__seealso">See Also</h5>
<div class="seealso">
<div><a class="xref" href="Discord.IEmote.html">IEmote</a></div>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/dev/apiSpec/new?filename=Discord_MessageExtensions_GetJumpUrl_Discord_IMessage_.md&amp;value=---%0Auid%3A%20Discord.MessageExtensions.GetJumpUrl(Discord.IMessage)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/dev/src/Discord.Net.Core/Extensions/MessageExtensions.cs/#L17">View Source</a>
</span>
<a id="Discord_MessageExtensions_GetJumpUrl_" data-uid="Discord.MessageExtensions.GetJumpUrl*"></a>
<h4 id="Discord_MessageExtensions_GetJumpUrl_Discord_IMessage_" data-uid="Discord.MessageExtensions.GetJumpUrl(Discord.IMessage)">GetJumpUrl(IMessage)</h4>
<div class="markdown level1 summary"><p>Gets a URL that jumps to the message.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GetJumpUrl(this IMessage msg)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Discord.IMessage.html">IMessage</a></td>
<td><span class="parametername">msg</span></td>
<td><p>The message to jump to.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>A string that contains a URL for jumping to the message in chat.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/dev/apiSpec/new?filename=Discord_MessageExtensions_RemoveReactionsAsync_Discord_IUserMessage_Discord_IUser_Discord_IEmote___Discord_RequestOptions_.md&amp;value=---%0Auid%3A%20Discord.MessageExtensions.RemoveReactionsAsync(Discord.IUserMessage%2CDiscord.IUser%2CDiscord.IEmote%5B%5D%2CDiscord.RequestOptions)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/dev/src/Discord.Net.Core/Extensions/MessageExtensions.cs/#L69">View Source</a>
</span>
<a id="Discord_MessageExtensions_RemoveReactionsAsync_" data-uid="Discord.MessageExtensions.RemoveReactionsAsync*"></a>
<h4 id="Discord_MessageExtensions_RemoveReactionsAsync_Discord_IUserMessage_Discord_IUser_Discord_IEmote___Discord_RequestOptions_" data-uid="Discord.MessageExtensions.RemoveReactionsAsync(Discord.IUserMessage,Discord.IUser,Discord.IEmote[],Discord.RequestOptions)">RemoveReactionsAsync(IUserMessage, IUser, IEmote[], RequestOptions)</h4>
<div class="markdown level1 summary"><p>Remove multiple reactions from a message.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Task RemoveReactionsAsync(this IUserMessage msg, IUser user, IEmote[] reactions, RequestOptions options = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Discord.IUserMessage.html">IUserMessage</a></td>
<td><span class="parametername">msg</span></td>
<td><p>The message to remove reactions from.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Discord.IUser.html">IUser</a></td>
<td><span class="parametername">user</span></td>
<td></td>
</tr>
<tr>
<td><a class="xref" href="Discord.IEmote.html">IEmote</a>[]</td>
<td><span class="parametername">reactions</span></td>
<td><p>An array of reactions to remove from the message</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Discord.RequestOptions.html">RequestOptions</a></td>
<td><span class="parametername">options</span></td>
<td><p>The options to be used when sending the request.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span></td>
<td><p>A task that represents the asynchronous operation for removing a reaction to this message.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Discord_MessageExtensions_RemoveReactionsAsync_Discord_IUserMessage_Discord_IUser_Discord_IEmote___Discord_RequestOptions__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method does not bulk remove reactions! If you want to clear reactions from a message,
<see cref="!:IUserMessage.RemoveAllReactionsAsync(RequestOptions)"></see></p>
</div>
<h5 id="Discord_MessageExtensions_RemoveReactionsAsync_Discord_IUserMessage_Discord_IUser_Discord_IEmote___Discord_RequestOptions__examples">Examples</h5>
<pre><code class="lang-cs">await msg.RemoveReactionsAsync(currentUser, new[] { A, B });</code></pre>
<h5 id="Discord_MessageExtensions_RemoveReactionsAsync_Discord_IUserMessage_Discord_IUser_Discord_IEmote___Discord_RequestOptions__seealso">See Also</h5>
<div class="seealso">
<div><a class="xref" href="Discord.IEmote.html">IEmote</a></div>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/goaaats/Discord.Net/new/dev/apiSpec/new?filename=Discord_MessageExtensions.md&amp;value=---%0Auid%3A%20Discord.MessageExtensions%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/goaaats/Discord.Net/blob/dev/src/Discord.Net.Core/Extensions/MessageExtensions.cs/#L8" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>