mirror of
https://github.com/zoriya/Aeris.git
synced 2026-06-01 18:35:45 +00:00
Fixing worker parameters substitution
This commit is contained in:
@@ -26,7 +26,7 @@ export class Runner {
|
||||
const ret: any = {};
|
||||
for (let [key, value] of Object.entries(params)) {
|
||||
let newValue = value;
|
||||
if (value instanceof String) {
|
||||
if (typeof value == "string") {
|
||||
newValue = value.replace(/{(\w*)(?:@(\d))?}/, (_, name, index) => {
|
||||
if (index)
|
||||
return this._history[parseInt(index)][name]
|
||||
|
||||
@@ -98,6 +98,7 @@ export class Youtube extends BaseService {
|
||||
|
||||
@reaction(ReactionType.YtComment, ["videoId", "body"])
|
||||
async reactComment(params: any): Promise<PipelineEnv> {
|
||||
try {
|
||||
let infos = await this._youtube.commentThreads.insert({
|
||||
part: ["snippet"],
|
||||
requestBody: {
|
||||
@@ -114,6 +115,10 @@ export class Youtube extends BaseService {
|
||||
return {
|
||||
ID: infos.data.id,
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(`youtube react comment error: ${e}`);
|
||||
throw new Error("Impossible to comment on this video. Comments may be disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
@reaction(ReactionType.YtAddToPlaylist, ["videoId", "playlistId"])
|
||||
|
||||
Reference in New Issue
Block a user