github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/discord.md (about) 1 --- 2 title: discord 3 type: input 4 status: experimental 5 categories: ["Services","Social"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/input/discord.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 :::caution EXPERIMENTAL 19 This component is experimental and therefore subject to change or removal outside of major version releases. 20 ::: 21 Consumes messages posted in a Discord channel. 22 23 24 <Tabs defaultValue="common" values={[ 25 { label: 'Common', value: 'common', }, 26 { label: 'Advanced', value: 'advanced', }, 27 ]}> 28 29 <TabItem value="common"> 30 31 ```yaml 32 # Common config fields, showing default values 33 input: 34 label: "" 35 discord: 36 channel_id: "" 37 bot_token: "" 38 poll_period: 1m 39 limit: 100 40 cache: "" 41 ``` 42 43 </TabItem> 44 <TabItem value="advanced"> 45 46 ```yaml 47 # All config fields, showing default values 48 input: 49 label: "" 50 discord: 51 channel_id: "" 52 bot_token: "" 53 poll_period: 1m 54 limit: 100 55 cache: "" 56 cache_key: last_message_id 57 rate_limit: "" 58 ``` 59 60 </TabItem> 61 </Tabs> 62 63 This input works by polling the `/channels/{channel_id}/messages` Discord API endpoint authenticated as a bot using token based authentication. The ID of the newest message consumed is stored in a cache in order to paginate results, ideally this cache should be persisted across restarts in order for the service to resume where it left off. 64 65 ## Fields 66 67 ### `channel_id` 68 69 A discord channel ID to consume messages from. 70 71 72 Type: `string` 73 74 ### `bot_token` 75 76 A bot token used for authentication. 77 78 79 Type: `string` 80 81 ### `poll_period` 82 83 The length of time (as a duration string) to wait between each poll for new messages. This field can be set empty, in which case requests are made at the limit set by the rate limit. This field also supports cron expressions. 84 85 86 Type: `string` 87 Default: `"1m"` 88 89 ### `limit` 90 91 The maximum number of messages to receive in a single request. 92 93 94 Type: `int` 95 Default: `100` 96 97 ### `cache` 98 99 A cache resource to use for request pagination, the ID of the last message received will be stored in this cache and used for subsequent requests. 100 101 102 Type: `string` 103 104 ### `cache_key` 105 106 The key identifier used when storing the ID of the last message received. 107 108 109 Type: `string` 110 Default: `"last_message_id"` 111 112 ### `rate_limit` 113 114 An optional rate limit resource to restrict API requests with. 115 116 117 Type: `string` 118 Default: `""` 119 120