mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-21 06:03:55 +00:00
Fix webook
This commit is contained in:
@@ -83,5 +83,6 @@ export const DISCORD = {
|
||||
COLOR_BLUE: 0x3498DB,
|
||||
COLOR_GREEN: 0x00D26A,
|
||||
COLOR_GRAY: 0x95A5A6,
|
||||
AVATAR_URL: 'https://media.discordapp.net/attachments/1421163952972369931/1434918661235282144/logo.png?ex=690a13a4&is=6908c224&hm=6bae81966da32e73a647f46fde268011fcf460c7071082dd5fd76cf22d04af65&=&format=png&quality=lossless&width=653&height=638'
|
||||
WEBHOOK_USERNAME: 'Microsoft-Rewards-Bot',
|
||||
AVATAR_URL: 'https://raw.githubusercontent.com/Obsidian-wtf/Microsoft-Rewards-Bot/main/assets/logo.png'
|
||||
} as const
|
||||
@@ -2,6 +2,7 @@ import axios from 'axios'
|
||||
import { Config } from '../interface/Config'
|
||||
import { Ntfy } from './Ntfy'
|
||||
import { log } from './Logger'
|
||||
import { DISCORD } from '../constants'
|
||||
|
||||
interface DiscordField {
|
||||
name: string
|
||||
@@ -51,7 +52,7 @@ export async function ConclusionWebhook(
|
||||
color: color || 0x0078D4,
|
||||
timestamp: new Date().toISOString(),
|
||||
thumbnail: {
|
||||
url: 'https://media.discordapp.net/attachments/1421163952972369931/1434299121098952958/v2.50.5.png?ex=6907d2a6&is=69068126&hm=1a11362e2c2c40fc9f8b67762abf17e5bae72e4b70567d4331de195a880ba043&=&format=png&quality=lossless&width=1024&height=1076'
|
||||
url: DISCORD.AVATAR_URL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +61,8 @@ export async function ConclusionWebhook(
|
||||
}
|
||||
|
||||
const payload: WebhookPayload = {
|
||||
username: 'MS Rewi',
|
||||
avatar_url: 'https://media.discordapp.net/attachments/1421163952972369931/1434299121098952958/v2.50.5.png?ex=6907d2a6&is=69068126&hm=1a11362e2c2c40fc9f8b67762abf17e5bae72e4b70567d4331de195a880ba043&=&format=png&quality=lossless&width=1024&height=1076',
|
||||
username: DISCORD.WEBHOOK_USERNAME,
|
||||
avatar_url: DISCORD.AVATAR_URL,
|
||||
embeds: [embed]
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import { Ntfy } from './Ntfy'
|
||||
import { loadConfig } from './Load'
|
||||
import { DISCORD } from '../constants'
|
||||
|
||||
const WEBHOOK_USERNAME = 'MS Rewards - Live Logs'
|
||||
|
||||
/**
|
||||
* Safe error logger for catch blocks
|
||||
* Use in .catch() to log errors without breaking flow
|
||||
@@ -82,7 +80,7 @@ async function sendBatch(url: string, buf: WebhookBuffer) {
|
||||
|
||||
// Enhanced webhook payload with embed, username and avatar
|
||||
const payload = {
|
||||
username: WEBHOOK_USERNAME,
|
||||
username: DISCORD.WEBHOOK_USERNAME,
|
||||
avatar_url: DISCORD.AVATAR_URL,
|
||||
embeds: [{
|
||||
description: `\`\`\`\n${content}\n\`\`\``,
|
||||
|
||||
Reference in New Issue
Block a user