Skip to content

Commit

Permalink
remove hardcoded DAO name and airdrop message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazymondaysunday committed Apr 14, 2022
1 parent 2417c4f commit 1ab24f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
30 changes: 3 additions & 27 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,13 @@ function truncateWords(sentence, amount, tail) {
}

client.on("message", (message) => {
//if (!channels.includes(message.channel.id)) return
if (message.content === "!airdrop") {
const exampleEmbed = {
color: 0x0099ff,
title: "Airdrop Resources",
url: "https://shapeshift.com/shapeshift-decentralize-airdrop",
description:
"Collection of helpful links for the ShapeShift DAO Airdrop.",
fields: [
{
name: "Links",
value:
"[1) How to Claim ⭢](https://shapeshift.zendesk.com/hc/en-us/articles/4403645992077-FOX-Airdrop-How-it-Works)\n[2) How long to Claim? ⭢](https://shapeshift.zendesk.com/hc/en-us/articles/4405404486285-How-Long-do-I-Have-to-Claim-My-FOX-)\n[3) Who is Eligible? ⭢](https://shapeshift.zendesk.com/hc/en-us/articles/4403645953037-Who-is-Eligible-to-Receive-Airdropped-FOX-)",
inline: true,
},
],
image: {
url: "https://assets.website-files.com/5cec55545d0f47cfe2a39a8e/60ee705019111828cd4ecf0e_ship-announcement-hero.jpg",
},
};
message.channel.send({ embed: exampleEmbed });
}
if (message.content === "!prop-template") {
message.channel.send(
"https://forum.shapeshift.com/t/shapeshift-proposal-template/54"
);
message.channel.send(process.env.PROP_TEMPLATE);
}
if (message.content === "!proposals") {
const resp = axios
.get(
"https://api.boardroom.info/v1/protocols/shapeshift/proposals?limit=50"
`https://api.boardroom.info/v1/protocols/${process.env.DAO}/proposals?limit=50`
)
.then((resp) => {
const data = resp.data.data;
Expand All @@ -105,7 +81,7 @@ client.on("message", (message) => {
.setColor(color)
.setTitle(title)
.setDescription(truncateWords(content, 25, "..."))
.setURL(`https://boardroom.io/shapeshift/proposal/${refId}`)
.setURL(`https://boardroom.io/${process.env.DAO}/proposal/${refId}`)
.addFields(
results.map((result) => {
const percentage = (result.total / totalVotes) * 100;
Expand Down
4 changes: 4 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BOT_TOKEN=ENTER_BOT_TOKEN
DISCORD_CHANNEL=["channelID", "channelID"]
DAO=example_project
PROP_TEMPLATE=https://example.com

0 comments on commit 1ab24f5

Please sign in to comment.