Created
July 21, 2023 18:37
-
-
Save Reinis-FRP/aac9b18f771de5173989a9d0f7862128 to your computer and use it in GitHub Desktop.
Proof of concept to open tickets from Discord bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client, GatewayIntentBits } = require("discord.js"); | |
require("dotenv").config(); | |
const message = `OptimisticOracleV2: Price Settlement Alert! | |
Detected a price request settlement for the request made by <https://etherscan.io/address/0x6A9D222616C90FcA5754cd1333cFD9b7fb6a4F74|0x6A9...6a4F74> at the timestamp 1689274376 for the identifier: YES_OR_NO_QUERY. The proposer was <https://etherscan.io/address/0x39c73c1fEDF4976A3f5205f844E31F65C08044aC|0x39c...8044aC> and the disputer was <https://etherscan.io/address/0x0000000000000000000000000000000000000000|0x000...000000>. The settlement price is 0.000. The payout was 1,755.00 made to the proposer. | |
Ancillary data: q: title: Will $XRP hit $1 by July 20?, description: This market will resolve to "Yes" if any Binance 1 minute candle for XRP/USDT between 2023/07/13 00:00 and 2023/07/20 23:59 in the ET timezone has a “High” price of 1.0000 or higher. Otherwise, this market will resolve to "No". | |
The resolution source for this market is https://www.binance.com, specifically the XRP/USDT “High” prices, currently available at https://www.binance.com/en/trade/XRP_USDT. The Binance API url for XRP/USDT may be used in the event that the chart is unavailable. | |
Please note that this market is about the price according to Binance XRP/USDT, not according to other sources or spot markets. res_data: p1: 0, p2: 1, p3: 0.5. Where p1 corresponds to No, p2 to Yes, p3 to unknown/50-50,initializer:91430cad2d3975766499717fa0d66a78d814e5c5. tx: <https://polygonscan.com/tx/0xecd73501d5f1cdec437046c337b9357e490dbb2378504ee0ee7beecebc8863cb|0xecd...8863cb>. <https://oracle.umaproject.org/request?transactionHash=0xecd73501d5f1cdec437046c337b9357e490dbb2378504ee0ee7beecebc8863cb&chainId=137&oracleType=OptimisticV2|View in UI>.`; | |
async function main() { | |
const client = new Client({ intents: [GatewayIntentBits.Guilds] }); | |
await client.login(process.env.TOKEN); | |
const channel = await client.channels.fetch(process.env.CHANNEL); | |
await channel.send("$ticket " + message); | |
} | |
main().then( | |
() => process.exit(0), | |
(err) => { | |
throw err; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment